itemtype必须是https://schema.org/开头的合法url且大小写敏感,需与itemscope成对使用,itemprop元素须嵌套在itemscope容器内,嵌套对象需独立声明itemscope和itemtype。

itemtype 必须是完整、合法的 HTTPS URL
itemtype 值不是随便写个字符串就行,它必须是 schema.org 官方定义的、以 https://schema.org/ 开头的完整 URL。常见错误包括:
• 写成 http://schema.org/Person(协议必须是 HTTPS)
• 拼错路径,比如 https://schema.org/person(大小写敏感,正确是 Person)
• 多加斜杠,如 https://schema.org/Person/(末尾不能有斜杠)
• 直接写 Person 或 "Person"(缺少协议和域名,完全无效)
浏览器和结构化数据解析器会直接忽略这种写法,不报错也不生效。
itemtype 必须与 itemscope 成对出现
itemtype 单独存在毫无意义,它必须紧贴在带有 itemscope 的元素上。如果只写:<div itemtype="https://schema.org/Article">...,但没加 <code>itemscope,那整个微数据块就“没启动”。
正确写法只有一种:<div itemscope itemtype="https://schema.org/Article">
<br>注意:<code>itemscope 是布尔属性,不需要赋值;itemtype 必须紧跟其后,二者属于同一元素的两个属性。
itemprop 元素必须在 itemscope 容器内部
所有带 itemprop 的子元素,必须真实嵌套在 itemscope 元素之内(DOM 树层级上),不能靠 JS 动态插入后才挂载,也不能用 display: none 或 visibility: hidden 隐藏整个容器——部分解析器会跳过不可见 scope。
典型翻车场景:
• 把 <span itemprop="name">张三</span> 放在 <div itemscope> 外面<br>• 用 <code>innerHTML 注入含 itemprop 的 HTML,但父容器尚未添加 itemscope 和 itemtype
• 在 Shadow DOM 中使用微数据,而解析器不支持该上下文
多层嵌套时 itemtype 指向错误的子对象
当结构化数据需要嵌套(例如 Article → author → Person),很多人会误把子对象的 itemtype 写在父元素上,或者漏掉子级的 itemscope。
错误示例:
<div itemscope itemtype="https://schema.org/Article"> <br> <span itemprop="author">张三</span> </div>
这里
author 是字符串,不是 Person 对象。要表达“作者是一个 Person”,必须:• 给
author 内容包一层新 <div itemscope itemtype="https://schema.org/Person">
<br>• 并在该新容器内用 <code>itemprop 声明子属性(如 name)否则搜索引擎只会提取出纯文本“张三”,无法识别为结构化实体。











