itemtype必须与itemscope绑定在同一元素上且值为完整HTTPS URL(如https://schema.org/Product),否则整块微数据被搜索引擎静默丢弃;单独使用itemtype、协议错误、大小写不符或末尾多斜杠均导致失效。

itemtype 必须和 itemscope 绑定,单独写等于没写
itemtype 不是“给某个元素打个类型标签”这么简单。它只在带有 itemscope 的元素上起作用,且必须是完整 HTTPS URL,比如 https://schema.org/Product。写成 Product、http://schema.org/Product 或少一个斜杠,Google Rich Results Test 就会直接报错或忽略整块。
常见错误:在 <p> 上加 itemtype="https://schema.org/Person" 却没加 itemscope;或者把 itemscope 加在 <span> 里,而 itemtype 写在父级 <div> —— 这两种都断链,解析器根本不会启动微数据收集。
-
itemscope是作用域开关,没有它,itemtype和itemprop都只是普通属性名 -
itemtype是契约,告诉解析器“这个作用域里描述的是什么”,不是可选配置项 - 同一元素不能有多个
itemtype,但可以有多个itemprop
itemprop 是字段绑定指令,不是内容提取器
itemprop 的值默认取元素的 textContent,不是 innerHTML、alt 或 href。这意味着:<p itemprop="name">iPhone <sup>®</sup></p> 提取出的值是 "iPhone ®",含 HTML 实体和符号——Google 可能拒收价格、日期等敏感字段。
不同属性类型要配不同写法:
立即学习“前端免费学习笔记(深入)”;
使用 PptxGenJS 和 Python 解析,将结构化的 HTML/CSS 幻灯片内容转换为原生、可编辑的 PowerPoint(.pptx)演示文稿。
- URL 类(如
image、url):必须用<link itemprop="image" href="logo.jpg">或<meta itemprop="url" content="https://example.com"> - 日期类(如
datePublished):优先用<time itemprop="datePublished" datetime="2026-10-13">今天</time> - 数值类(如
price):显式用content属性,<div itemprop="price" content="5999">¥5999</div> - 多值字段(如
review、author):必须拆成多个独立元素,不能逗号分隔文本
嵌套结构里 itemprop 和 itemscope 必须紧贴,中间不能插 wrapper
当某个字段本身是另一个实体(比如作者、地址),嵌套的 itemscope 必须作为 itemprop 的直接载体。否则 Google 会丢弃整个嵌套块,连带外层数据也可能失效。
✅ 正确:<div itemprop="author" itemscope itemtype="https://schema.org/Person">张三</div>
❌ 错误:<div itemprop="author"><div itemscope itemtype="https://schema.org/Person">张三</div></div> —— itemprop="author" 没绑定到任何 itemscope,解析器无从判断“张三”属于谁的 author。
LocalBusiness 地址嵌套中漏掉 postalCode 或 addressCountry 是高频问题,会导致地图功能不触发,不是报错而是静默降权。
itemtype 选错类型,比不加还危险
类型不是越具体越好,而是最贴合页面核心意图。企业首页写 https://schema.org/LocalBusiness,不是 Organization;文章页用 Article,不是 WebPage。Google 对类型匹配度极敏感,错配会导致 rich result 被拒,甚至影响索引优先级。
更隐蔽的问题是:同一个 itemscope 容器里混用冲突属性。比如在 itemtype="https://schema.org/Person" 下写 itemprop="price",Rich Results Test 会明确报错 “Property price is not a valid property of Person”。
验证环节不能跳过——必须用 Google 的 Rich Results Test 实时检测,本地改完不等于线上生效,HTTPS URL 是否可访问、大小写是否一致、嵌套层级是否断裂,全靠它暴露。


















