itemtype必须是完整HTTPS URL,如https://schema.org/Person,禁用Person、https://schema.org/Person/、http://schema.org/Person等写法;嵌套结构中每层均需独立声明itemscope与itemtype,且itemprop须紧邻对应itemscope元素。

itemtype 必须是完整 HTTPS URL,不能拼接或截断
itemtype 值不是字符串占位符,而是机器可验证的类型标识。写成 Person、https://schema.org/Person/(末尾斜杠)、http://schema.org/Person 或 //schema.org/Person 全部无效。
浏览器和 Google Rich Results Test 会直接忽略整块 microdata。正确写法只有一种:https://schema.org/Person —— 协议、域名、路径全小写、无斜杠、无空格。
- 多个嵌套层级,每一层都必须独立声明自己的
itemtype,不能复用外层值 - LocalBusiness 下的
address字段必须是https://schema.org/PostalAddress,不是https://schema.org/Address(后者不存在) - Offer 的
priceCurrency是字符串,但priceSpecification是另一个对象,需另起itemscope itemtype="https://schema.org/UnitPriceSpecification"
嵌套结构里 itemprop 和 itemscope 必须紧邻,中间不能插 wrapper
这是最常被忽略的硬性规则:如果某个 itemprop 的值本身是一个结构化对象(比如作者、地址、评论),那么该对象的 itemscope 必须直接写在同一个 HTML 元素上,不能隔一层 <div> 或 <span>。
错误示例:<p itemprop="author"><div itemscope itemtype="https://schema.org/Person">张三</div></p> —— itemprop="author" 没绑定到任何 itemscope,Google 解析时直接丢弃整个 author 节点。
立即学习“前端免费学习笔记(深入)”;
正确写法只有这一种:<p itemprop="author" itemscope itemtype="https://schema.org/Person">张三</p>。
将调研报告、方案对比、数据分析、需求梳理、会议纪要、设计说明、代码评审、学习笔记等任务产物输出为可在浏览器直接打开的单文件 HTML,替代 Markdown 作为最终交付物。Markdown 在信息密度、视觉清晰度和可分享性上已跟不上 AI 产物的丰富度,HTML 能同时承载排版、表格、SVG 等。
- 嵌套越深,越容易漏掉某一层的
itemscope itemtype,建议每加一层就跑一次 Google Rich Results Test -
<meta itemprop="name" content="iPhone">这类隐藏字段可以脱离可见内容,但依然要确保其父元素有itemscope - 地址类嵌套常漏掉
postalCode或addressCountry,导致 LocalBusiness 标记不完整,地图功能失效
同一 itemscope 内多次使用相同 itemprop 会被自动转为数组
比如一篇文章有多个作者,不需要手动构造 JSON 数组,只需重复写 itemprop="author" 并各自包裹 itemscope itemtype:
<div itemscope itemtype="https://schema.org/Article"> <h1 itemprop="headline">标题</h1> <div itemprop="author" itemscope itemtype="https://schema.org/Person">张三</div> <div itemprop="author" itemscope itemtype="https://schema.org/Person">李四</div> </div>
Google 会把这两个 author 合并为一个数组,而不是覆盖或报错。
- 这种写法只适用于 schema.org 明确允许多值的属性(如
review、author、sameAs) - 价格、日期等单值字段(如
price、datePublished)重复写会导致解析失败或取最后一个值 - 不要试图用
itemprop="author" content="张三,李四"来“简化”,microdata 不支持逗号分隔的字符串数组
itemprop 提取的是 textContent,不是 innerHTML
itemprop 绑定的是元素的纯文本内容,所有 HTML 标签、实体、换行都会被保留。比如:<p itemprop="name">iPhone <sup>®</sup></p>,实际提取值是 "iPhone ®",Google 可能拒收。
需要干净值时,优先用 <meta> 替代:
<meta itemprop="name" content="iPhone 15">-
<time itemprop="datePublished" datetime="2026-07-03">2026年7月3日</time>——datetime属性才是机器读取的值,显示文本可任意 -
<meta itemprop="price" content="299.00">—— 避免 ¥ 符号、逗号、空格混入
复合嵌套最难的不是写法,而是每一层都得对齐 schema.org 官方定义:类型名、属性名、值类型、嵌套关系,缺一不可。漏掉一个 itemscope,或写错一个 URL 斜杠,整块数据就归零。


















