itemtype必须与itemscope成对出现于同一元素,且值为Schema.org完整HTTPS URL;itemprop须严格匹配类型定义属性;验证须用Google Rich Results Test。

HTML 中的 itemtype 不是独立可用的属性,它必须和 itemscope 成对出现在同一元素上,且值必须是 Schema.org 的完整 HTTPS URL;写错格式、漏掉作用域、类型与属性不匹配,整块结构化数据都会被搜索引擎静默丢弃。
itemtype 必须是完整 HTTPS URL,不能缩写或拼错
浏览器和 Google 爬虫只认标准词汇表里的绝对地址,比如 https://schema.org/LocalBusiness。任何偏差都会导致解析失败:
-
http://schema.org/LocalBusiness—— HTTP 协议已停用,2026 年起完全无效 -
//schema.org/LocalBusiness—— 相对协议,实际解析为http://yoursite.com/schema.org/LocalBusiness,404 -
https://schema.org/LocalBusiness/—— 末尾多斜杠,Rich Results Test 报错或忽略 -
LocalBusiness或schema.org/LocalBusiness—— 不是合法 URI,等同于没写
查类型最稳的方式:打开 https://schema.org/LocalBusiness(注意结尾无斜杠),确认页面顶部显示 “Type: LocalBusiness”,且 URL 完全匹配。
itemscope 和 itemtype 必须写在同一 HTML 元素上
这是硬性语法要求,不是风格建议。分离写法等于放弃整个微数据块:
立即学习“前端免费学习笔记(深入)”;
- ❌ 错误:
<div itemscope><section itemtype="https://schema.org/Restaurant">...</section></div>——itemtype没绑定到itemscope所在元素 - ❌ 更隐蔽错误:
<div><section itemscope itemtype="https://schema.org/Restaurant">...</section></div>—— 外层<div> 无 <code>itemscope,但很多人误以为它“继承”了作用域 - ✅ 正确:
<section itemscope itemtype="https://schema.org/Restaurant">...</section> -
telephone在https://schema.org/LocalBusiness下合法,在https://schema.org/Event下非法 -
byArtist是MusicRecording的标准属性,写成byartist或artist就失效 -
datePublished要求机器可读时间值,只写 “1994年” 不行,得用<time itemprop="datePublished" datetime="1994-09-23">1994年</time> - 嵌套地址时,
address本身是实体,不能直接赋字符串:<div itemprop="address">北京市朝阳区</div>是无效的;必须写成<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">...</div> - CSS 隐藏(
display: none或visibility: hidden)导致内容不可见,Google 拒绝索引 - JS 动态渲染的结构化数据,爬虫可能未执行 JS 就结束了抓取
-
<meta>标签中用了itemprop,但对应值不可见(name、description等除外) - 同一页面多个
itemscope嵌套混乱,或itemprop跨越了作用域边界
推荐直接复用语义标签(如 <article></article>、<main></main>、<section></section>)作容器,比套空 <div> 更干净,也利于 SEO。
<h3>itemprop 值必须严格匹配 itemtype 定义的属性</h3>
<p>Schema.org 类型决定了哪些 <code>itemprop 是合法的。填错字段名、大小写不对、或把属性塞进错误类型,都会被忽略:
验证必须用 Google Rich Results Test,不能只看源码
即使 HTML 里所有标签都写对了,也可能因以下原因不被识别:
真正关键的是测试工具返回的解析结果——它反映的是 Google 实际看到的结构化数据。很多线上页面源码看着完美,Rich Results Test 却报 “No structured data detected”,问题几乎都出在这三处:缺 itemscope、itemtype URL 格式错、或 itemprop 不在作用域内。



















