itemtype必须是完整HTTPS URL且与itemscope同标签:https://schema.org/Product(大小写敏感、无尾斜杠、不可省略协议),二者须共存于同一HTML开始标签,嵌套结构中亦需严格遵循此规则。

itemtype 必须写成完整 HTTPS URL,不能简写或省略协议
直接写 itemtype="Product" 或 itemtype="https://schema.org/product" 都会失败。Google Rich Results Test 会静默丢弃整块微数据,不报错也不提示——你根本不知道它没生效。
合法值只有一种格式:https://schema.org/Product(注意大小写、协议、无尾斜杠)。2026 年起所有 HTTP 版本(如 http://schema.org/Product)和旧 vocab(如 http://data-vocabulary.org/Person)已全量停用。
-
https://schema.org/Article✅ -
https://schema.org/article❌(小写) -
https://schema.org/Article/❌(末尾斜杠) -
schema.org/Article❌(缺协议) -
Article❌(纯字符串,非 URL)
itemtype 必须和 itemscope 写在同一 HTML 标签里
这是硬性语法要求,不是风格建议。分离写法等于没写。
错误示例:<div itemscope><section itemtype="https://schema.org/Book"></section></div> —— itemtype 没绑定到 itemscope 所在元素,解析器找不到作用域起点。
立即学习“前端免费学习笔记(深入)”;
正确写法必须是:<section itemscope itemtype="https://schema.org/Book">。两者缺一不可,且必须共存于同一个开始标签中。
- 不能靠父级“继承”:外层
itemscope不会让子元素自动获得类型上下文 - 不能用 JS 动态添加:DOM 必须静态可解析,否则 Google 不识别
-
<time>、<span>等内联元素不能作为itemscope容器,必须用<article>、<section>、<div>等块级容器
怎么查对的 itemtype 值?别从 schema.org 首页瞎搜
在 schema.org 首页搜 “Restaurant”,可能跳转到重定向页或带斜杠的 URL,比如 https://schema.org/Restaurant/ —— 这个结尾斜杠就是致命错误。
正确路径是:打开 https://schema.org/Restaurant(手动输入,确保结尾无斜杠),拉到页面底部看 “More specific Types” 或顶部 “Type hierarchy”,确认它是顶层或合适子类。重点看它是否定义了你要用的 itemprop,比如 priceRange 只在 Restaurant 有效,不在 LocalBusiness 中定义。
- 企业官网首页 → 优先
https://schema.org/Organization - 带地址/电话的门店页 → 优先
https://schema.org/LocalBusiness或更具体子类(如Restaurant、BeautySalon) - 品牌名称展示页 → 用
https://schema.org/Brand,不是Organization - 文章页 → 用
https://schema.org/Article,不是WebPage
嵌套结构里,子 itemtype 怎么加才不被忽略
当属性本身是个对象(比如作者、地址、产品图),嵌套的 itemscope itemtype 必须紧贴 itemprop 所在元素,不能中间插 wrapper。
错误:<div itemprop="author"><div><div itemscope itemtype="https://schema.org/Person"></div></div></div> —— itemprop="author" 和它的 itemscope 不是直接父子关系,Google 会丢弃整个嵌套块。
正确:<div itemprop="author" itemscope itemtype="https://schema.org/Person"></div>。地址同理:<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">。
容易被忽略的一点:嵌套类型也必须是完整 HTTPS URL,比如 https://schema.org/PostalAddress,不是 PostalAddress 或 https://schema.org/postaladdress。



















