Web

Recipe Schema Best Practices: WebPage isPartOf (JSON-LD)

Use Recipe schema with isPartOf linked to the WebPage (Option 2). Implement JSON-LD for clean structured data to boost SEO and appear in recipe rich results.

1 answer 1 view

Which schema.org structure should I use for marking up a Recipe? I have two options:

Option 1:
Recipe

  • mainEntityOfPage → page URL
  • isPartOf → Article
  • isPartOf → WebPage
  • isPartOf → WebSite

Option 2:
Recipe

  • mainEntityOfPage → page URL
  • isPartOf → WebPage
  • isPartOf → WebSite

Which option is correct or recommended for JSON-LD/microdata and for SEO? Should the Recipe be nested under an Article (Option 1) or bePartOf the WebPage directly (Option 2)? Please explain the semantic differences and show a recommended JSON-LD example for the preferred structure.

For marking up a Recipe with schema.org structured data, Option 2—where the Recipe uses isPartOf to link directly to the WebPage (which itself is part of the WebSite)—is the recommended approach for both JSON-LD and SEO. This keeps things simpler and more semantically accurate for most recipe pages, avoiding unnecessary nesting under an Article unless your content is distinctly an editorial piece with the recipe as a subsection. Google favors clean, validated Recipe schema that highlights key details like ingredients and cook time in rich results, and Option 2 aligns better without overcomplicating the hierarchy.


Contents


What is Recipe Schema?

Recipe schema turns your cooking instructions into machine-readable gold for search engines. Imagine dropping a <script type="application/ld+json"> block on your page—suddenly, Google can pull out prep time, ingredients, and ratings to show eye-catching rich snippets. Straight from schema.org/Recipe, it’s a subtype of CreativeWork designed for exactly this: recipes with fields like cookTime (in ISO 8601 format, say PT1H for one hour), recipeIngredient arrays, and even nutrition info.

Why bother? Pages without it might just show a boring blue link. With it? Stars, thumbnails, and calorie counts that snag more clicks. But the real question hits when your recipe lives on a blog post—is it part of an “Article,” or just the page itself?


Option 1 vs. Option 2: Key Differences

Let’s break down your choices side-by-side. Option 1 nests deeply: Recipe → isPartOf Article → isPartOf WebPage → isPartOf WebSite. It’s like saying, “This recipe is buried in a story, inside a page, on a site.”

Option 2 streamlines: Recipe → isPartOf WebPage → isPartOf WebSite. No Article middleman. Both use mainEntityOfPage pointing to the page URL, which tells search engines this is the star content.

Aspect Option 1 (Nested under Article) Option 2 (Direct to WebPage)
Hierarchy Depth Deeper (4 levels) Shallower (3 levels)
Best For Long-form blog posts where recipe is a section Dedicated recipe pages or primary content
JSON-LD Complexity More objects, potential validation snags Cleaner, easier to maintain
SEO Risk Over-nesting can confuse parsers Matches Google’s simple examples

Google’s structured data intro shows recipes powering rich results without heavy nesting—think quick, scannable markup.


Semantic Differences Explained

Semantics matter because schema.org is about meaning, not just data dumps. isPartOf signals containment: “This thing belongs within that one.” In Option 1, you’re declaring the Recipe as a component of an Article—a narrative piece with byline, publish date, maybe images beyond the dish. Makes sense for a 2,000-word “My Grandma’s Lasagna Story” where instructions are midway.

Flip to Option 2: Recipe directly isPartOf WebPage. Here, the page is the recipe—no fluff required. WebPage is broader (any HTML page), so it fits standalone recipe sites or when the post is 90% instructions. Per schema.org docs, you don’t need nesting; @id references or flat @graph arrays work too.

Over-nest, and you risk dilution—search engines might prioritize the Article over your Recipe properties. A Stack Overflow thread nails it: nesting’s optional; use URIs for links instead.

Ever tested in Google’s Rich Results tool? Option 1 might flag warnings if the Article lacks meaty content.


Why Option 2 Wins for SEO and Implementation

SEO pros lean Option 2 because it’s pragmatic. Google’s Recipe guidelines stress validation and completeness over hierarchy gymnastics—no mention of mandatory Articles. Sites like food blogs see rich results faster with direct WebPage links, per Bootstrapped Ventures.

Implementation? JSON-LD shines here—Google’s preferred format. It’s non-blocking (sits in <head> or <body>), async-friendly. Tools like Yoast output @graph with WebPage + Recipe siblings, not deep nests (Yoast spec). For hierarchy, add isPartOf to WebSite sparingly; focus on Recipe yield, instructions, images.

Result? Higher CTR from carousels. One study-ish note from 20i blog: isPartOf shines for site structure, but don’t force it on content entities.


Recommended JSON-LD Example

Here’s Option 2 in action—a full, production-ready snippet. Paste into a <script type="application/ld+json"> tag. Tweak for your banana bread or whatever.

json
{
 "@context": "https://schema.org",
 "@graph": [
 {
 "@type": "Recipe",
 "@id": "https://example.com/banana-bread#recipe",
 "name": "Mom's Famous Banana Bread",
 "author": {
 "@type": "Person",
 "@id": "https://example.com/author/john#author",
 "name": "John Smith"
 },
 "datePublished": "2026-01-10",
 "description": "Classic banana bread with walnuts—moist and nutty.",
 "image": "https://example.com/banana-bread.jpg",
 "prepTime": "PT15M",
 "cookTime": "PT1H",
 "totalTime": "PT1H15M",
 "recipeYield": "1 loaf",
 "recipeCategory": "Dessert",
 "recipeCuisine": "American",
 "recipeIngredient": [
 "3 ripe bananas",
 "1 egg",
 "3/4 cup sugar"
 ],
 "recipeInstructions": [
 {
 "@type": "HowToStep",
 "text": "Preheat oven to 350°F."
 }
 ],
 "nutrition": {
 "@type": "NutritionInformation",
 "calories": "240 calories"
 },
 "mainEntityOfPage": {
 "@type": "WebPage",
 "@id": "https://example.com/banana-bread"
 },
 "isPartOf": {
 "@type": "WebPage",
 "@id": "https://example.com/banana-bread#page"
 }
 },
 {
 "@type": "WebPage",
 "@id": "https://example.com/banana-bread#page",
 "isPartOf": {
 "@type": "WebSite",
 "@id": "https://example.com#website",
 "name": "Your Food Site"
 },
 "mainEntity": {
 "@id": "https://example.com/banana-bread#recipe"
 }
 }
 ]
}

Validate at Google’s Rich Results Test. @graph lets siblings reference via @id—efficient, no bloat.


Best Practices for Recipe Markup

Keep it real: Match visible content exactly—no hidden calories if your page doesn’t mention them. Use arrays for ingredients/instructions; HowToStep for steps boosts voice search.

JSON-LD over Microdata—less brittle, per Chicory. Test often; fix non-criticals too (Google advice).

For food blogs? Pair with aggregateRating. Tools like Recipe Kit automate, but hand-code for control.

Pitfall? Spammy markup kills eligibility. Be genuine.


Sources

  1. schema.org/Recipe
  2. Google Structured Data Intro
  3. schema.org Getting Started
  4. Bootstrapped Ventures Recipe Schema
  5. Google Recipe Markup
  6. 20i Schema Hierarchy
  7. Yoast Schema Spec
  8. Stack Overflow Nesting Discussion

Conclusion

Stick with Option 2 for your Recipe schema—it’s semantically tight, SEO-friendly, and easier to scale. Direct isPartOf WebPage respects the page’s focus while nodding to site structure, dodging the Article trap unless you’re writing essays. Drop that JSON-LD example, validate, and watch rich results roll in. Your recipes deserve the spotlight—don’t bury them.

Authors
Verified by moderation
Moderation
Recipe Schema Best Practices: WebPage isPartOf (JSON-LD)