Skip to main content
seofields
docs

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
namestringThe name of the recipe.
descriptionstringA description of the recipe.
imagestring | objectImage of the finished recipe — a URL string or a full ImageObject.
authorstring | objectThe author of the recipe — a URL string or a Person/Organization object.
totalTimestringTotal time to make the recipe in ISO 8601 duration format (e.g. "PT45M").
recipeCategorystringCategory of the recipe (e.g. "Dessert", "Main Course", "Appetizer").
recipeIngredientarray of stringsList of ingredients required for the recipe.
recipeInstructions[].namestringName of this instruction step.
recipeInstructions[].textstringDetailed 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 theschemaOrgRecipe 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?