Recipe (Recipe, HowTo, ItemList) structured data

Help users find your recipe content by telling Google about your recipe with structured data. When you provide information such as reviewer ratings, cooking and preparation times, and nutrition information, Google can better understand your recipe and present it to users in interesting ways. Recipes can appear in Google Search results and Google Images.

An illustration of how recipe rich results can appear in Google Search. It contains 4 rich results from different websites, with details about how long it takes to cook the recipe, an image, and review information. An illustration of how a recipes can appear in Google Images. There are 6 images results showing different food items, with 3 results containing a recipe badge that tells the user it's a recipe

Based on how you mark up your content, your recipes can be eligible for the following enhancements:

Recipe enhancements
Recipe host carousel: Enable users to explore your recipe gallery pages by adding ItemList structured data. An illustration of how a recipe host carousel can appear in Google Search. It shows 3 different recipes from the same website in a carousel format that users can explore and select a specific recipe

如何添加结构化数据

结构化数据是一种提供网页相关信息并对网页内容进行分类的标准化格式。如果您不熟悉结构化数据,可以详细了解结构化数据的运作方式

下面概述了如何构建、测试和发布结构化数据。如需获得向网页添加结构化数据的分步指南,请查看结构化数据 Codelab

  1. 添加必要属性。根据您使用的格式,了解在网页上的什么位置插入结构化数据
  2. 遵循指南
  3. 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。此外,您还可以考虑修正该工具中可能会标记的任何非严重问题,因为这些这样有助于提升结构化数据的质量(不过,要使内容能够显示为富媒体搜索结果,并非必须这么做)。
  4. 部署一些包含您的结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、noindex 标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址
  5. 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图Search Console Sitemap API 可以帮助您自动执行此操作。

Examples

Here are some examples of recipes using JSON-LD code.

Recipe on Search

Here's an example of a page that's eligible to be displayed on Search.

<html>
  <head>
    <title>Non-Alcoholic Piña Colada</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@type": "Recipe",
      "name": "Non-Alcoholic Piña Colada",
      "image": [
      "https://example.com/photos/1x1/photo.jpg",
      "https://example.com/photos/4x3/photo.jpg",
      "https://example.com/photos/16x9/photo.jpg"
      ],
      "author": {
        "@type": "Person",
        "name": "Mary Stone"
      },
      "datePublished": "2024-03-10",
      "description": "This non-alcoholic pina colada is everyone's favorite!",
      "recipeCuisine": "American",
      "prepTime": "PT1M",
      "cookTime": "PT2M",
      "totalTime": "PT3M",
      "keywords": "non-alcoholic",
      "recipeYield": "4 servings",
      "recipeCategory": "Drink",
      "nutrition": {
        "@type": "NutritionInformation",
        "calories": "120 calories"
      },
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": 5,
        "ratingCount": 18
      },
      "recipeIngredient": [
        "400ml of pineapple juice",
        "100ml cream of coconut",
        "ice"
      ],
      "recipeInstructions": [
        {
          "@type": "HowToStep",
          "name": "Blend",
          "text": "Blend 400ml of pineapple juice and 100ml cream of coconut until smooth.",
          "url": "https://example.com/non-alcoholic-pina-colada#step1",
          "image": "https://example.com/photos/non-alcoholic-pina-colada/step1.jpg"
        },
        {
          "@type": "HowToStep",
          "name": "Fill",
          "text": "Fill a glass with ice.",
          "url": "https://example.com/non-alcoholic-pina-colada#step2",
          "image": "https://example.com/photos/non-alcoholic-pina-colada/step2.jpg"
        },
        {
          "@type": "HowToStep",
          "name": "Pour",
          "text": "Pour the pineapple juice and coconut mixture over ice.",
          "url": "https://example.com/non-alcoholic-pina-colada#step3",
          "image": "https://example.com/photos/non-alcoholic-pina-colada/step3.jpg"
        }
      ],
      "video": {
        "@type": "VideoObject",
        "name": "How to Make a Non-Alcoholic Piña Colada",
        "description": "This is how you make a non-alcoholic piña colada.",
        "thumbnailUrl": [
          "https://example.com/photos/1x1/photo.jpg",
          "https://example.com/photos/4x3/photo.jpg",
          "https://example.com/photos/16x9/photo.jpg"
         ],
        "contentUrl": "https://www.example.com/video123.mp4",
        "embedUrl": "https://www.example.com/videoplayer?video=123",
        "uploadDate": "2024-02-05T08:00:00+08:00",
        "duration": "PT1M33S",
        "interactionStatistic": {
          "@type": "InteractionCounter",
          "interactionType": { "@type": "WatchAction" },
          "userInteractionCount": 2347
        },
        "expires": "2024-02-05T08:00:00+08:00"
       }
    }
    </script>
  </head>
  <body>
  </body>
</html>

Here's an example of a recipe summary page (a page with a list of recipes) with itemList structured data. This content may be eligible to be displayed in a grid in Search results.

<html>
  <head>
    <title>Grandma's Best Pie Recipes</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "ItemList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "url": "https://example.com/apple-pie.html"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "url": "https://example.com/blueberry-pie.html"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "url": "https://example.com/cherry-pie.html"
        }]
    }
    </script>
  </head>
  <body>
  </body>
</html>

Guidelines

You must follow the general structured data guidelines for your markup to be eligible to appear in Search results.

The following guidelines apply to Recipe structured data.

  • Use Recipe structured data for content about preparing a particular dish. For example, "facial scrub" or "party ideas" are not valid names for a dish.
  • To enable your recipes to appear in a carousel or grid, you must follow these guidelines:
    • Provide ItemList structured data to summarize the recipes for your list. You can provide ItemList structured data separately or together with recipe structured data.
    • Your site must have a summary page that lists all the recipes in the collection. For example, when a user clicks the summary link from Search results, they are properly directed to a page on your site listing the recipes related to their search.

Structured data type definitions

You must include the required properties for your content to be eligible for display as a rich result in Google Search. You can also include the recommended properties to add more information about your content, which could provide a better user experience.

Recipe

Mark up your recipe content with the following properties of the schema.org Recipe type. The full definition of Recipe is available at schema.org/Recipe. The Google-supported properties are the following:

Required properties
image

URL or ImageObject

Image of the completed dish.

Additional image guidelines:

  • Image URLs must be crawlable and indexable. To check if Google can access your URLs, use the URL Inspection tool.
  • Images must represent the marked up content.
  • Images must be in a file format that's supported by Google Images.
  • For best results, we recommend providing multiple high-resolution images (minimum of 50K pixels when multiplying width and height) with the following aspect ratios: 16x9, 4x3, and 1x1.

For example:

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
name

Text

The name of the dish.

Recommended properties
aggregateRating

AggregateRating

Annotation for the average review score assigned to the item. Follow the Review snippet guidelines and list of required and recommended AggregateRating properties.

If the Recipe structured data contains a single review, the reviewer's name must be a valid person or organization. For example, "50% off ingredients" is not a valid name for a reviewer.

author

Person or Organization

The name of the person or organization that wrote the recipe. To help Google best understand authors across various features, consider following the author markup best practices.

cookTime

Duration

The time it takes to actually cook the dish in ISO 8601 format, if applicable.

Always use in combination with prepTime.

datePublished

Date

The date the recipe was published in ISO 8601 format, if applicable.

description

Text

A short summary describing the dish.

keywords

Text

Other terms for your recipe such as the season ("summer"), the holiday ("Halloween"), or other descriptors ("quick", "easy", "authentic").

Additional guidelines

  • Separate multiple entries in a keywords list with commas.
  • Don't use a tag that's actually a recipeCategory or recipeCuisine.

    Not recommended:

    "keywords": "dessert, American"

    Recommended:

    "keywords": "winter apple pie, nutmeg crust"
nutrition.calories

Energy

The number of calories in each serving produced with this recipe. If nutrition.calories is defined, recipeYield must be defined with the number of servings.

prepTime

Duration

The length of time it takes to prepare ingredients and workspace for the dish, in ISO 8601 format, if applicable.

Always use in combination with cookTime.

recipeCategory

Text

The type of meal or course your recipe is about. For example: "dinner", "main course", or "dessert, snack".

recipeCuisine

Text

The region associated with your recipe. For example, "French", Mediterranean", or "American".

recipeIngredient

Text

An ingredient used in the recipe.

For example:

"recipeIngredient": [
  "1 (15 ounce) package double crust ready-to-use pie crust",
  "6 cups thinly sliced, peeled apples (6 medium)",
  "3/4 cup sugar",
  "2 tablespoons all-purpose flour",
  "3/4 teaspoon ground cinnamon",
  "1/4 teaspoon salt",
  "1/8 teaspoon ground nutmeg",
  "1 tablespoon lemon juice"
]

Additional guidelines:

  • Include only the ingredient text that is necessary for making the recipe.
  • Don't include unnecessary information, such as a definition of the ingredient.
recipeInstructions

HowToStep, HowToSection, or Text

The steps to make the dish.

There are several options for setting the value of recipeInstructions. We recommend using HowToStep. HowToSection can also be used to group HowToSteps when the recipe has sections.

  • HowToStep: Specify this recipe's steps with HowToStep.
    "recipeInstructions": [
      {
        "@type": "HowToStep",
        "name": "Preheat",
        "text": "Heat oven to 425°F.",
        "url": "https://example.com/recipe#step1",
        "image": "https://example.com/photos/recipe/step1.jpg"
      }, {
        "@type": "HowToStep",
        "name": "Prepare crust",
        "text": "Place 1 pie crust in ungreased 9-inch glass pie plate, pressing firmly against side and bottom.",
        "url": "https://example.com/recipe#step2",
        "image": "https://example.com/photos/recipe/step2.jpg"
      }, {
        "@type": "HowToStep",
        "name": "Make filling",
        "text": "In large bowl, gently mix filling ingredients; spoon into crust-lined pie plate.",
        "url": "https://example.com/recipe#step3",
        "image": "https://example.com/photos/recipe/step3.jpg"
      }, {
        "@type": "HowToStep",
        "name": "Cover",
        "text": "Top with second crust. Cut slits or shapes in several places in top crust.",
        "url": "https://example.com/recipe#step4",
        "image": "https://example.com/photos/recipe/step4.jpg"
      }, {
        "@type": "HowToStep",
        "name": "Bake",
        "text": "Bake 40 to 45 minutes. The pie is ready when the apples are tender and the crust is golden brown.",
        "url": "https://example.com/recipe#step5",
        "image": "https://example.com/photos/recipe/step5.jpg"
      }, {
        "@type": "HowToStep",
        "name": "Cool",
        "text": "Cool on cooling rack at least 2 hours before serving.",
        "url": "https://example.com/recipe#step6",
        "image": "https://example.com/photos/recipe/step6.jpg"
      }
    ]
  • HowToSection (only if a recipe has multiple sections): Use to group steps into multiple sections. See HowToSection for an example.
  • Single or repeated property of text: A block of text that includes one or more steps. Google treats all steps as being in a single section. Repeated property values are concatenated into a single block of text. Google then attempts to automatically split the single block of text into individual steps. Google tries to find and remove any section names, step numbers, keywords, and anything else that can incorrectly appear in recipe step text. For best results, we recommend you unambiguously specify steps with HowToStep.
    "recipeInstructions": [
      "In large bowl, gently mix filling ingredients; spoon into crust-lined pie
    plate. Top with second crust. Cut slits or shapes in several places in top
    crust. Bake 40 to 45 minutes. The pie is ready when the or until apples are
    tender and the crust is golden brown. Cool on cooling rack at least 2 hours
    before serving."
    ]

Additional guidelines

  • Don't include metadata that belongs elsewhere. In particular, use the author property to specify the author, recipeCuisine for cuisine, recipeCategory for category, and keywords for other keywords.
  • Include only text on how to make the dish and don't include other text such as "Directions", "Watch the video", "Step 1". Specify those phrases outside of structured data.

    Not recommended:

    "recipeInstructions": [{
      "@type": "HowToStep",
      "text": "Step 1. Heat oven to 425°F."
    }]

    Recommended:

    "recipeInstructions": [{
      "@type": "HowToStep",
      "text": "Heat oven to 425°F."
    }]
recipeYield

Text or Integer

The quantity produced by the recipe, if applicable. Specify the number of servings produced from this recipe with just a number. If you wish to use a different unit (for example, number of items), you may include additional yields. This is required if you specify any nutritional information per serving (such as nutrition.calories).

Example

"recipeYield": [
  "6",
  "24 cookies"
]
totalTime

Duration

The total time it takes to prepare the cook the dish, in ISO 8601 format, if applicable.

Use totalTime or a combination of both cookTime and prepTime.

video VideoObject

A video depicting the steps to make the dish. Follow the list of required and recommended Video properties.

HowToSection

Use HowToSection to group a sequence of steps (or sub-sections) that make up part of the instructions for a recipe. Specify HowToSection directly within the definition of recipeInstructions property, or as an itemListElement of another HowToSection.

The HowToSection type defines a section of a single recipe and contains one or multiple steps. Don't use HowToSection to define different recipes for the same dish; instead, use HowToSection as part of a single recipe. For listing multiple recipes for a dish, use multiple Recipe objects. For example, for multiple ways to make an apple pie, list them as multiple Recipe objects, not HowToSection objects.

The full definition of HowToSection is available at schema.org/HowToSection.

Required properties
itemListElement HowToStep

A list of detailed steps for the section, and/or sub-sections. For example, a pizza recipe may have one section of steps for making the crust, one for preparing the toppings, and one for combining and baking.

Example:

{
  "@type": "HowToSection",
  "name": "Assemble the pie",
  "itemListElement": [
    {
      "@type": "HowToStep",
      "text": "In large bowl, gently mix filling ingredients; spoon into crust-lined pie plate."
    }, {
      "@type": "HowToStep",
      "text": "Top with second crust. Cut slits or shapes in several places in top crust."
    }
  ]
}
name Text

The name of the section.

HowToStep

Use HowToStep to group one or more sentences that explain how to do part of the recipe, if this makes sense for your content. Define the text property with the sentences or, alternately, define itemListElement with a HowToDirection or HowToTip for each sentence.

Mark up your recipe steps with the following properties of the HowToStep type. Specify a HowToStep directly within the definition of recipeInstructions property, or as an itemListElement of a HowToSection.

The full definition of HowToStep is available at schema.org/HowToStep.

Required properties
itemListElement HowToDirection or HowToTip

A list of detailed substeps, including directions or tips.

Optional if text is used.

text Text

The full instruction text of this step.

Optional if itemListElement is used. Additional guidelines:

  • Include only instructional text and don't include other text such as "Directions", "Watch the video", "Step 1". Specify those phrases outside of the marked up property.

    Not recommended:

    {
      "@type": "HowToStep",
      "text": "Step 1. Heat oven to 425°F."
    }

    Recommended:

    {
      "@type": "HowToStep",
      "text": "Heat oven to 425°F."
    }
Recommended properties
image ImageObject or URL

An image for the step. Additional image guidelines:

  • Image URLs must be crawlable and indexable.
  • Images must represent the marked up content.
  • Images must be in .jpg, .png, or. gif format.
name Text

The word or short phrase summarizing the step (for example, "Arrange pie crust"). Don't use non-descriptive text (for example, "Step 1: [text]") or other form of step number (for example, "1. [text]").

url URL

A URL that directly links to the step (if one is available). For example, an anchor link fragment.

video VideoObject or Clip

A video for this step or a clip of the video.

For VideoObject, follow the list of required and recommended Video or Clip properties.

HowToDirection and HowToTip

Use HowToDirection and HowToTip to describe directions or tips, if applicable. They have the same required and recommended properties.

The full definitions of HowToDirection and HowToTip are available at schema.org/HowToDirection and schema.org/HowToTip.

Required properties
text Text

The text of the direction or tip.

ItemList

In addition to Recipe properties, add the following properties for host-specific lists. While ItemList isn't required, you must add the following properties if you want your recipe to be eligible for a host carousel. For more information about host carousel, see Carousel.

The full definition of ItemList is available at schema.org/ItemList.

Required properties
itemListElement

ListItem

Annotation for a single item page.

ListItem.position

Integer

Ordinal position of the item page in the list. For example:

"itemListElement": [
  {
    "@type": "ListItem",
    "position": 1,
  }, {
    "@type": "ListItem",
    "position": 2,
  }
]
ListItem.url

URL

The canonical URL of the item page. Every item must have a unique URL.

Monitor rich results with Search Console

Search Console is a tool that helps you monitor how your pages perform in Google Search. You don't have to sign up for Search Console to be included in Google Search results, but it can help you understand and improve how Google sees your site. We recommend checking Search Console in the following cases:

  1. After deploying structured data for the first time
  2. After releasing new templates or updating your code
  3. Analyzing traffic periodically

After deploying structured data for the first time

After Google has indexed your pages, look for issues using the relevant Rich result status report. Ideally, there will be an increase of valid items, and no increase in invalid items. If you find issues in your structured data:

  1. Fix the invalid items.
  2. Inspect a live URL to check if the issue persists.
  3. Request validation using the status report.

After releasing new templates or updating your code

When you make significant changes to your website, monitor for increases in structured data invalid items.
  • If you see an increase in invalid items, perhaps you rolled out a new template that doesn't work, or your site interacts with the existing template in a new and bad way.
  • If you see a decrease in valid items (not matched by an increase in invalid items), perhaps you are no longer embedding structured data in your pages. Use the URL Inspection tool to learn what is causing the issue.

Analyzing traffic periodically

Analyze your Google Search traffic using the Performance Report. The data will show you how often your page appears as a rich result in Search, how often users click on it and what is the average position you appear on search results. You can also automatically pull these results with the Search Console API.

问题排查

如果您在实施或调试结构化数据时遇到问题,请查看下面列出的一些实用资源。

  • 如果您使用了内容管理系统 (CMS) 或其他人负责管理您的网站,请向其寻求帮助。请务必向其转发列明问题细节的任何 Search Console 消息。
  • Google 不能保证使用结构化数据的功能一定会显示在搜索结果中。如需查看导致 Google 无法将您的内容显示为富媒体搜索结果的各种常见原因,请参阅结构化数据常规指南
  • 您的结构化数据可能存在错误。请参阅结构化数据错误列表
  • 如果您的网页受到结构化数据手动操作的影响,其中的结构化数据将会被忽略(但该网页仍可能会出现在 Google 搜索结果中)。如需修正结构化数据问题,请使用“人工处置措施”报告
  • 再次查看相关指南,确认您的内容是否未遵循指南。问题可能是因为出现垃圾内容或使用垃圾标记导致的。不过,问题可能不是语法问题,因此富媒体搜索结果测试无法识别这些问题。
  • 针对富媒体搜索结果缺失/富媒体搜索结果总数下降进行问题排查
  • 请等待一段时间,以便 Google 重新抓取您的网页并重新将其编入索引。请注意,网页发布后,Google 可能需要几天时间才会找到和抓取该网页。有关抓取和索引编制的常见问题,请参阅 Google 搜索抓取和索引编制常见问题解答
  • Google 搜索中心论坛中发帖提问。