itemtype 必须与 itemscope、itemprop 配合使用才生效,单独存在会被浏览器和搜索引擎忽略;必须用完整 https uri(如“https://schema.org/person”),大小写敏感且不可省略协议或尾部斜杠;嵌套实体需逐层声明 itemscope 和对应 itemtype。

itemtype 本身不生效,必须和 itemscope、itemprop 配合使用,否则浏览器和搜索引擎完全忽略它。
为什么单独写 itemtype 没用
HTML 解析器看到 itemtype 属性时,不会做任何结构化处理。它只是 Schema.org 类型的 URI 标识符,比如 "https://schema.org/Person",但只有当父容器同时有 itemscope 时,这个 URI 才被当作当前微数据块的类型定义。
常见错误现象:
- 写了
itemtype="https://schema.org/Article"但没加itemscope→ Google Rich Results Test 显示“未检测到结构化数据” - 把
itemtype放在<div> 外层,而 <code>itemprop在内层无itemscope的元素上 → 属性丢失上下文,无法关联到类型itemtype必须用完整 HTTPS URI,不能缩写或简写Schema.org 明确要求使用带协议的绝对 URL,
itemtype值不是类名字符串,而是可解析的命名空间地址。写成"Person"、"schema:Person"或"//schema.org/Person"全部无效。正确写法示例:
<div itemscope itemtype="https://schema.org/Person"> <span itemprop="name">张三</span> <span itemprop="jobTitle">前端工程师</span> </div>
注意点:
anything-to-html下载将调研报告、方案对比、数据分析、需求梳理、会议纪要、设计说明、代码评审、学习笔记等任务产物输出为可在浏览器直接打开的单文件 HTML,替代 Markdown 作为最终交付物。Markdown 在信息密度、视觉清晰度和可分享性上已跟不上 AI 产物的丰富度,HTML 能同时承载排版、表格、SVG 等。
- Google 和 Bing 当前仍兼容
http://schema.org/...,但必须迁移到https://(HTTP/2+ 环境下非 https 可能被拦截或警告) - 不要加尾部斜杠:
"https://schema.org/Person/"是错的 - 大小写敏感:
"https://schema.org/person"不匹配官方定义
嵌套
itemtype时,每个层级都要独立声明itemscope一个页面常需描述多个实体(如文章作者是 Person,文章所属网站是 Organization),这时不能靠“继承”,必须显式嵌套并逐层标记。
错误写法(外层
itemscope无法覆盖内层无itemscope的元素):<div itemscope itemtype="https://schema.org/Article"> <h1 itemprop="headline">标题</h1> <div itemprop="author"> <!-- 缺少 itemscope --> <span itemprop="name">李四</span> </div> </div>正确写法:
<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>关键细节:
-
itemprop="author"是 Article 的属性,它的值是一个 Person 实体,所以该子容器必须带itemscope+ 对应itemtype - 如果作者是组织(比如媒体机构),则
itemtype应改为"https://schema.org/Organization",不能复用 Person 的类型 - 多值属性(如
itemprop="author"出现两次)会自动聚合为数组,无需额外标记
最容易被忽略的是:所有
itemprop值必须落在带有itemscope的元素内部,哪怕只差一层 DOM 嵌套,结构化数据就会断裂。调试时优先检查itemscope是否漏写、是否闭合、是否被 JavaScript 动态移除。 - Google 和 Bing 当前仍兼容










