itemtype 必须为完整 HTTPS URL“https://schema.org/Recipe”,且须与itemscope成对出现于语义容器(如<article>)上;子对象需单独声明对应itemtype,且name、recipeIngredient、recipeInstructions三字段缺一不可。

itemtype 必须用完整 HTTPS Schema URL
标记菜谱时,itemtype 只能是 https://schema.org/Recipe,不能简写为 Recipe、schema.org/Recipe 或用 HTTP 协议。Google Structured Data Testing Tool 和 Rich Results Test 会直接忽略非完整 HTTPS 的值。
- ✅ 正确:
<article itemscope itemtype="https://schema.org/Recipe"> - ❌ 错误:
<article itemscope itemtype="Recipe"> - ❌ 错误:
<article itemscope itemtype="http://schema.org/Recipe"> - ❌ 错误:
<div itemscope itemtype="https://schema.org/Recipe">(没语义容器,建议优先用<article>)
必须和 itemscope 成对出现,且只能在外层容器上
itemscope 和 itemtype 是绑定关系,缺一不可;它们声明的是一个独立实体的作用域起点,不能只写其中一个,也不能放在 <p>、<span> 这类内联元素上。
- 作用域必须包裹全部 recipe 字段:菜名、原料、步骤、图片等都要在同一个
<article itemscope itemtype="https://schema.org/Recipe">内部 - 多个菜谱要各自独立声明:不能用一个
itemscope包住整页三道菜,否则itemprop会跨实体混淆 - 推荐复用已有语义标签:
<article>比<div>更合适,既满足微数据要求,又保持 HTML 结构清晰
别把 itemtype 用在嵌套子对象上
当需要标记作者、营养信息或视频等子实体时,itemtype 要换为对应类型,且必须紧贴在 itemprop 所在元素上——不能隔层,也不能复用外层的 Recipe。
文章转信息图。将文章/笔记转化为手机可读的 HTML 信息图,自动匹配视觉风格。触发场景:文章转图、笔记转图、信息图、转小红书图、做张图、可视化这篇文章、文生图。
- 作者是 Person:
<div itemprop="author" itemscope itemtype="https://schema.org/Person"><span itemprop="name">李明</span></div> - 营养信息是 NutritionInformation:
<div itemprop="nutrition" itemscope itemtype="https://schema.org/NutritionInformation"><meta itemprop="calories" content="250 kcal"></div> - ❌ 错误:
<div itemprop="author"><div itemscope itemtype="https://schema.org/Person">...</div></div>(itemprop="author"没绑定到任何itemscope)
常见失效原因:字段缺失或类型错配
即使 itemtype 写对了,Google 也不会识别 Recipe 富摘要,除非同时满足三个强制字段:name、recipeIngredient、recipeInstructions。这些字段的值类型和结构也必须合规。
立即学习“前端免费学习笔记(深入)”;
-
recipeIngredient必须是字符串数组,不是单个字符串或带 HTML 的节点 -
recipeInstructions推荐用<ol>+itemprop="recipeInstructions",每项<li>自动转为字符串数组;若手动写 JSON-LD,则需确保是 HowToStep 对象数组 - 用
<time itemprop="datePublished" datetime="2026-10-03">今天</time>比纯文本更稳妥,避免日期解析失败
最常被忽略的一点:所有 itemprop 值必须可被提取为干净文本,含 HTML 标签、空格或实体符号(如 ®)会导致字段被丢弃——这和 itemtype 本身无关,但会让人误以为是类型写错了。


















