itemtype必须是完整HTTPS URL,不能缩写或省略协议;需与itemscope同层共存,指向可访问且返回200的schema.org等权威词汇表地址,如https://schema.org/Product。

itemtype必须是完整 HTTPS URL,不能缩写或省略协议
itemtype不是随便填的字符串,它必须指向一个可验证的、外部定义的词汇表地址。主流解析器(包括 Google Rich Results Test)只认 https://schema.org/ 开头的绝对 URL,且协议必须是 https,不能是 http 或协议相对路径(//schema.org/Person)。
常见错误包括:
-
itemtype="Person"—— 缺少 URL,纯字符串无效 -
itemtype="http://schema.org/Person"—— HTTP 协议已被拒绝 -
itemtype="https://schema.org/Person/"—— 末尾斜杠非法(官方文档明确要求无尾部斜杠) -
itemtype="./vocab#Product"—— 相对路径,无法被外部解析器访问
✅ 正确写法:itemtype="https://schema.org/Product"、itemtype="https://schema.org/LocalBusiness"
itemtype必须和itemscope成对出现在同一元素上
单独写 itemscope 或单独写 itemtype 都不会触发微数据解析。它们必须共存于同一个容器元素,表示“这里是一个实体,类型是 XXX”。
这个容器推荐用语义化标签,比如 错误示例: schema.org 的类型之间有严格契约关系。比如 选 type 的关键不是“越细越好”,而是匹配页面核心意图: 查类型最稳妥的方式是直访 WHATWG 规范和 Google 工具都要求:itemtype 值对应的 URL 在 HTTP 层必须可访问且返回 200 状态码。这不是要你部署一个 JSON-LD 接口,而是指该 URL 至少能被浏览器打开(比如 这意味着: 验证前务必用 Google Rich Results Test 实时抓取你的页面,它会明确告诉你哪个 、 或 —— itemtype 没和 itemscope 同层,无效 —— 空元素,无内容可绑定属性,Google 可能忽略不同类型对应不同itemtype,选错会导致属性失效
itemprop="price" 只在 https://schema.org/Offer 或 https://schema.org/Product 下合法;如果写在 https://schema.org/Person 里,Google 工具会直接报错:“Property price is not a valid property of Person”。
https://schema.org/LocalBusiness
https://schema.org/Article
https://schema.org/FoodEvent 或 https://schema.org/MenuItem,而非硬套 Product
https://schema.org/,点进目标类型页,看 “Properties” 列表是否包含你要用的 itemprop 名。itemtype URL 必须能返回 HTTP 200,哪怕内容只是 HTML 页面
https://schema.org/Product 确实返回一个 HTML 页面)。
https://yoursite.com/vocab#Person)必须真实存在并返回 200,否则结构化数据会被丢弃file:// 或 localhost 路径,Google 工具无法验证,会提示“URL unreachable”itemtype URL 不可达或格式错误。
前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!











