itemtype属性必须与itemscope搭配使用才有效,单独使用无效;其值必须为完整https协议的schema.org标准url,大小写敏感且需可访问;多类型用空格分隔但仅首项被google识别。

itemtype 属性必须搭配 itemscope 使用才有效
单独写 itemtype 没有任何结构化数据效果,浏览器和搜索引擎完全忽略。它只是定义类型,而 itemscope 才是声明“这里是一个独立实体”的开关。
常见错误是只加 itemtype 却漏掉 itemscope,结果在 Google Rich Results Test 里完全不识别。
- 正确写法:
<div itemscope itemtype="https://www.php.cn/link/2ad908ea29b45df4bf8b2a3136690429"> <li>错误写法:<code><div itemtype="https://www.php.cn/link/2ad908ea29b45df4bf8b2a3136690429">(无 itemscope) <li>也支持自闭合标签内使用,比如:<code><meta itemscope itemtype="https://schema.org/Organization"> - 常用类型 URL 示例:
https://www.php.cn/link/2ad908ea29b45df4bf8b2a3136690429、https://schema.org/LocalBusiness、https://schema.org/Recipe - 嵌套时可换类型:父容器用
https://schema.org/WebPage,内部某区块用https://schema.org/Review - 避免用过时的
http://schema.org/...(HTTP 协议已被主流爬虫拒收) -
Person可用:name、jobTitle、alumniOf -
Restaurant可用:name、servesCuisine、priceRange - 跨类型复用需显式声明新
itemscope:<span itemprop="alumniOf" itemscope itemtype="https://schema.org/EducationalOrganization">...</span> - 真要表达复合类型,优先选更具体的子类(如直接用
https://schema.org/Restaurant,它已继承LocalBusiness) - 若必须组合(如既是
Event又是CreativeWork),建议拆成嵌套结构,外层声明主类型,内层用itemprop引用其他类型实体 - 微软 Bing 和 Yandex 偶尔支持多值,但不可依赖;生产环境应以 Google 行为为准
itemtype 的值只能是合法的 Schema.org 类型 URL
不能写简称、本地路径或拼错的地址。例如 itemtype="Person" 或 itemtype="/schema/Person" 都无效,必须用完整 HTTPS URL。
Schema.org 官方只认标准命名空间,且大小写敏感。比如 https://schema.org/Article 有效,但 https://schema.org/article(小写 a)会被忽略。
itemtype 和 itemprop 需要语义对齐,否则字段被丢弃
不是所有属性名都能随便往任意类型上挂。比如给 itemtype="https://www.php.cn/link/2ad908ea29b45df4bf8b2a3136690429" 加 itemprop="recipeIngredient",Google 会直接跳过这个属性——因为 recipeIngredient 不属于 Person 的合法属性。
文章转信息图。将文章/笔记转化为手机可读的 HTML 信息图,自动匹配视觉风格。触发场景:文章转图、笔记转图、信息图、转小红书图、做张图、可视化这篇文章、文生图。
查对方法很简单:打开对应类型的 Schema.org 页面(如 https://www.php.cn/link/2ad908ea29b45df4bf8b2a3136690429),只使用「Properties」列表里明确列出的 itemprop 名称。
多类型共存时用空格分隔,但实际支持有限
HTML5 允许 itemtype 写多个 URL,用空格分隔,表示该元素同时属于多种类型。但现实是——Google Structured Data Testing Tool 和 Rich Results Test **只识别第一个**。
例如:itemtype="https://schema.org/LocalBusiness https://schema.org/Restaurant",工具只按 LocalBusiness 解析,后面那个被无视。
真正容易被忽略的是:itemtype 的 URL 必须可 HTTP 访问(哪怕只是返回 200 的空页),某些内网部署或带鉴权的 schema 域名会导致解析失败——这不是规范要求,而是 Google 抓取器的实际行为。










