itemtype值必须是HTTPS协议的Schema.org官方类型URL,如https://schema.org/Person;须首字母大写、不可缩写或小写;每个itemscope需独立声明;还需配合合法itemprop及正确数据格式才能生效。

itemtype 值必须是有效的 URL(通常是 Schema.org 类型地址)
itemtype 的作用是声明当前 itemscope 区域所描述的结构化数据类型,它不是随便写的字符串,而必须是一个**可解析、有语义定义的 URL**。最常用的是 https://schema.org/ 下的类型,比如 https://schema.org/Person、https://schema.org/Article。浏览器不校验这个 URL 是否真实返回内容,但搜索引擎和结构化数据工具(如 Google Rich Results Test)会依赖它做语义识别。
常见错误是写成相对路径、缩写或本地标识符,例如:Person、/schema/Person、schema:Person —— 这些都无效,会导致结构化数据解析失败。
不要用 http://schema.org(旧协议)
虽然 http://schema.org/Person 在历史上曾被接受,但现在所有主流工具(Google、Bing、Yandex)都要求使用 HTTPS 协议。用 HTTP 地址可能被静默忽略,或在验证工具中报“invalid itemtype”警告。
正确写法只有一种:https://schema.org/Type,其中 Type 首字母大写,且必须是 Schema.org 官方定义的类名(不是自定义词)。
立即学习“前端免费学习笔记(深入)”;
-
https://schema.org/Organization✅ -
https://schema.org/LocalBusiness✅(它是 Organization 的子类,也合法) -
https://schema.org/product❌(小写 product 不是有效类名) -
https://schema.org/Article✅,但https://schema.org/article❌
嵌套 itemtype 时,每个 itemscope 必须单独声明
一个页面可以有多个结构化数据块,每个 itemscope 都要配自己的 itemtype。不能靠父级推导子级类型。
例如:描述一家公司及其 CEO,CEO 是 Person 类型,必须显式写出:
<div itemscope itemtype="https://schema.org/Organization">
<span itemprop="name">Acme Corp</span>
<div itemscope itemtype="https://schema.org/Person">
<span itemprop="name">Jane Doe</span>
</div>
</div>
如果子 div 漏掉 itemtype,即使有 itemscope,它也不会被识别为 Person 实体 —— 只是一个无类型的空 scope。
验证 itemtype 是否生效,别只看 HTML 源码
写对了 itemtype 不等于结构化数据就跑通。还要检查:
- 对应属性名(
itemprop)是否属于该类型在 Schema.org 上定义的合法属性(比如https://schema.org/Person支持name、jobTitle,但不支持category) - 嵌套层级是否符合类型约束(例如
author属性期望值是Person或Organization,不能是纯文本) - 使用 Google Rich Results Test 或 Schema Markup Validator 实际抓取渲染结果,而不是仅靠浏览器查看源码
很多问题出在 itemtype 对了,但 itemprop 错了,或者值类型不匹配(比如把日期写成 “2024-05-10” 字符串却没加 content 属性标注机器可读格式)。itemtype 是起点,不是终点。



















