itemtype 必须与 itemscope 同元素出现且为完整 HTTPS schema.org URL,否则整块微数据被搜索引擎忽略;两者缺一不可,嵌套实体需各自声明,验证须用 Google Rich Results Test。

itemtype 必须是完整 HTTPS URL,且和 itemscope 写在同一元素上,否则整个微数据块会被搜索引擎直接忽略。
itemtype 必须和 itemscope 同元素出现
它不是可选修饰,而是结构化数据的类型声明起点。没有 itemtype,itemscope 就只是个空作用域;没有 itemscope,itemtype 就没绑定对象。两者必须像 itemscope itemtype="https://schema.org/Product" 这样紧挨着写在同一个标签里。
常见错误包括:
- 把
itemtype单独写在子元素上,比如<p itemtype="https://schema.org/Person">张三</p>—— 没有itemscope,无效 - 把
itemscope和itemtype拆到父子元素:<div itemscope><p itemtype="https://schema.org/Person">张三</p></div>—— 解析器找不到类型上下文,整块丢弃 - 用语义标签但漏掉其中一者,比如
<article itemscope><h1 itemprop="name">标题</h1></article>—— 缺itemtype,Google Rich Results Test 显示“未检测到结构化数据”
itemtype 值必须是合法 schema.org HTTPS URL(末尾不能带斜杠)
截至 2026 年,Google 只认 https://schema.org/ 开头的地址,且必须返回 HTTP 200。任何缩写、协议降级或路径错误都会导致验证失败。
立即学习“前端免费学习笔记(深入)”;
正确写法示例:
-
https://schema.org/Product✅(推荐,简洁、稳定) -
https://schema.org/LocalBusiness✅ -
https://schema.org/Recipe✅
错误写法示例:
-
http://schema.org/Product❌(HTTP 协议已被拒绝) -
//schema.org/Product❌(协议相对路径,部分爬虫无法解析) -
https://schema.org/Product/❌(末尾斜杠非法,URL 不匹配 schema.org 官方定义) -
Product或"Person"❌(字符串不是可验证 URL) -
./vocab/person❌(相对路径,无外部语义)
itemtype 定义的是类型主干,不是属性列表
它只告诉解析器“这个容器描述的是什么”,不负责字段合法性校验。字段是否可用,取决于你后续写的 itemprop 是否属于该类型在 schema.org 上定义的 Properties。
比如:
-
itemtype="https://schema.org/Product"下,itemprop="price"合法,但itemprop="alumni"会报错(那是Organization的属性) -
itemtype="https://schema.org/Person"下,itemprop="telephone"合法,但在Event类型里写就无效 - 同一
itemscope内可以多次使用相同itemprop(如多个review),会自动转为数组,但前提是该属性确属该类型支持的多值字段
查证方式:打开 https://schema.org/{Type} 页面,滚动到底部看 “Properties” 表格,确认你要用的 itemprop 名是否列在其中。
嵌套结构中,每个子实体都要独立声明 itemtype
当某个 itemprop 对应的是另一个实体(如作者、地址、评论者),它不是字符串,而是一个新对象,必须显式开启新作用域。
正确写法:
<div itemscope itemtype="https://schema.org/Article">
<h1 itemprop="headline">标题</h1>
<div itemprop="author" itemscope itemtype="https://schema.org/Person">
<span itemprop="name">张三</span>
</div>
</div>
错误写法:
<div itemscope itemtype="https://schema.org/Article">
<h1 itemprop="headline">标题</h1>
<div itemprop="author">
<div itemscope itemtype="https://schema.org/Person">张三</div>
</div>
</div>
原因:itemprop="author" 没绑定到任何 itemscope,内层 itemscope 失去父级上下文,Google 直接丢弃整个嵌套块。这种错误在地址、菜单、组织架构等多层嵌套场景中极易发生,且不易肉眼察觉。
最易被忽略的一点:itemtype 不影响页面渲染或 JS 行为,但它一旦写错,结构化数据就完全失效——不是“部分字段缺失”,而是整块 itemscope 被爬虫跳过。验证必须用 Google Rich Results Test,不能靠“看起来正常”来判断。



















