Skip to main content
seofields
docs
.md

Recipe

The Recipe schema type describes a cooking or baking recipe. It powers Google's recipe carousel, voice answers via Google Assistant, and the "Cook" mode rich result — consistently the highest-ROI structured data for food publishers.

About Recipe

For carousel eligibility you need name, image, recipeIngredient, and recipeInstructions. Always express times in ISO 8601 (e.g. PT30M) — Google rejects free-form values like "30 mins". For non-cooking step-by-step content (DIY, tutorials), use the more general HowTo type instead.

Fields

FieldTypeRequiredDescription
namestring✓The name of the recipe.
descriptionstring—A description of the recipe.
imagestring | object—Image of the finished recipe — a URL string or a full ImageObject.
authorstring | object—The author of the recipe — a URL string or a Person/Organization object.
totalTimestring—Total time to make the recipe in ISO 8601 duration format (e.g. "PT45M").
recipeCategorystring—Category of the recipe (e.g. "Dessert", "Main Course", "Appetizer").
recipeIngredientarray of strings—List of ingredients required for the recipe.
recipeInstructions[].namestring—Name of this instruction step.
recipeInstructions[].textstring—Detailed text instructions for this step.

Plugin Registration

sanity.config.ts
import { defineConfig } from 'sanity'
import { schemaOrgRecipePlugin } from 'sanity-plugin-seofields/schema'

export default defineConfig({
  plugins: [
    schemaOrgRecipePlugin(),
  ],
})

Schema Usage

Add the schemaOrgRecipe field to any document schema:

schemas/recipe.ts
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'recipe',
  title: 'Recipe',
  type: 'document',
  fields: [
    defineField({
      name: 'schemaOrgRecipe',
      title: 'Recipe Schema',
      type: 'schemaOrgRecipe',
    }),
  ],
})

GROQ Query

GROQ query
*[_type == "yourDocument"][0]{
  schemaOrgRecipe {
    name,
    description,
    image,
    author,
    totalTime,
    recipeCategory,
    recipeIngredient,
    recipeInstructions[] {
      name,
      text
    }
  }
}

Next.js Component

app/recipes/[slug]/page.tsx
import { RecipeSchema } from 'sanity-plugin-seofields/schema/next'

export default function Page({ data }) {
  return <RecipeSchema data={data.schemaOrgRecipe} />
}

JSON-LD Output

Generated JSON-LD
{
  "@context": "https://schema.org",
  "@type": "Recipe",
  "name": "Chocolate Chip Cookies",
  "description": "Classic homemade chocolate chip cookies that are crispy on the outside and chewy in the middle.",
  "image": "https://example.com/cookies.jpg",
  "author": {
    "@type": "Person",
    "name": "Jane Baker"
  },
  "totalTime": "PT30M",
  "recipeCategory": "Dessert",
  "recipeIngredient": [
    "2 cups all-purpose flour",
    "1 cup butter",
    "2 cups chocolate chips"
  ],
  "recipeInstructions": [
    {
      "@type": "HowToStep",
      "name": "Preheat oven",
      "text": "Preheat the oven to 375°F (190°C)."
    },
    {
      "@type": "HowToStep",
      "name": "Mix ingredients",
      "text": "Cream butter and sugar, then add eggs and vanilla extract."
    }
  ]
}

Was this page helpful?