What rich snippets are and why search engines show them

A rich snippet is extra information that appears below your website's title and description in search results — things like star ratings, prices, cooking times, or event dates. Search engines pull this information from code you add to your pages, not from the visible text itself. When you format this code correctly, Google and other search engines can understand what your page is actually about and display those details to people searching.

Rich snippets matter because they make your search result stand out. A recipe with a five-star rating and a 30-minute cooking time gets clicked more often than the same recipe with no extra information. An event listing that shows the date and ticket price answers the searcher's question before they even visit your site. You are not changing what your page says — you are telling search engines what information is already there, in a language they understand.

The code you add is called structured data, and it lives in the HTML of your page. You do not need to change how your website looks or works. The structured data is invisible to visitors — it is only for search engines to read.

Key Takeaways

  • Rich snippets are created by adding structured data code to your website's HTML, which tells search engines what information on your page means.
  • Schema.org provides the standard vocabulary that Google, Bing, and other search engines all recognize and use to display rich snippets.
  • The three most common formats for structured data are JSON-LD, microdata, and RDFa, with JSON-LD being the easiest for most website owners to use.
  • You can test your structured data with Google's Rich Results Test before publishing to see whether search engines will actually display the snippet.
  • Not every page needs rich snippets, but recipes, events, products, reviews, and articles are the types that search engines most often show with extra information.

Understanding Schema.org and structured data vocabulary

Search engines need a shared language to understand what information means on your page. That language is called Schema.org, a collaborative project created by Google, Bing, Yahoo, and Yandex. Schema.org provides a list of standard terms — called a vocabulary — that describe different types of content. For example, a recipe page uses terms like "recipeName", "prepTime", "cookTime", and "recipeYield". A product page uses "name", "price", "priceCurrency", and "aggregateRating".

You do not have to memorize this vocabulary. Schema.org maintains a searchable list at schema.org itself, organized by content type. When you decide what kind of rich snippet you want to create, you look up the correct type (Recipe, Product, Event, Article, and so on) and find the fields that match the information on your page. Each field has a name and a description of what kind of information goes there.

The vocabulary is the same across all search engines. Whether you are optimizing for Google, Bing, or another engine, the structured data code you write uses the same Schema.org terms. This consistency is why Schema.org matters — it is the standard that makes rich snippets possible.

The three formats for writing structured data: JSON-LD, microdata, and RDFa

Once you know what information you want to mark up, you need to choose a format — a way to write the code. The three main formats are JSON-LD, microdata, and RDFa. Each one works, but they look different and have different strengths.

JSON-LD is the easiest format for most people. It is a block of code that sits in the head or body of your HTML page and reads almost like a list. You write the information in curly brackets, separated by commas, with each field labeled clearly. JSON-LD does not require you to change the visible HTML of your page — you just add the code block alongside everything else. Google recommends JSON-LD, and most modern website builders and content management systems (like WordPress) have plugins that generate JSON-LD for you.

Microdata is written directly into your HTML tags. Instead of a separate block of code, you add attributes to the tags that already display your content. For example, if you have a paragraph tag that shows a recipe name, you add an attribute that tells search engines "this is a recipe name". Microdata works well if you are comfortable editing HTML, but it requires more changes to your existing code.

RDFa is similar to microdata — it adds attributes to your HTML tags — but it uses a different syntax. RDFa is less common than the other two and is usually chosen only when a website already uses RDFa for other purposes. For most people starting out, JSON-LD is the right choice.

How to write JSON-LD structured data for a recipe

A recipe page is one of the most common uses for rich snippets. Here is how to add JSON-LD code to a recipe page so that search engines can display the cooking time, yield, and star rating.

First, gather the information you want to include: the recipe name, prep time, cook time, total time, number of servings, ingredients list, instructions, and any ratings or reviews. You do not have to include every possible field — only the ones that are actually on your page.

Next, open a text editor or your website's code editor and add this block of code to the head section of your HTML page (between the <head> and </head> tags):

<script type="process/ld+json"> { "@context": "https://schema.org/", "@type": "Recipe", "name": "Chocolate Chip Cookies", "author": { "@type": "Person", "name": "Jane Smith" }, "prepTime": "PT15M", "cookTime": "PT10M", "totalTime": "PT25M", "recipeYield": "24 cookies", "recipeIngredient": [ "2 cups flour", "1 cup butter", "1 cup sugar" ], "recipeInstructions": [ { "@type": "HowToStep", "text": "Preheat oven to 375 degrees." }, { "@type": "HowToStep", "text": "Mix butter and sugar together." } ], "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.5", "ratingCount": "48" } } </script>

Replace the example values with the actual information from your recipe. The times use a format called ISO 8601 — "PT" means period of time, "H" means hours, and "M" means minutes. Fifteen minutes is "PT15M", one hour is "PT1H", and one hour thirty minutes is "PT1H30M".

Once you have added the code, save the page and move to the next step: testing it with Google's tool.

Testing your structured data with Google's Rich Results Test

Before you publish your page, test the structured data to make sure search engines can read it correctly. Google provides a free tool called the Rich Results Test at rich-results.dev.

Go to rich-results.dev, paste the URL of your page (if it is already live) or paste the HTML code directly into the text box. Click the Test button. The tool will scan your code and tell you whether the structured data is valid and whether Google can display a rich snippet for it.

If the test shows errors, it will tell you exactly what is wrong — for example, a missing required field, a misspelled field name, or a time format that does not match the standard. Fix the errors in your code and test again. If the test shows a green checkmark and displays a preview of how your rich snippet will look in search results, you are ready to publish.

Keep in mind that passing the test does not may provide that Google will show the rich snippet. Google also considers whether the page is high-quality, whether it matches what the searcher is looking for, and other ranking factors. But if your structured data is valid, you have done everything on your end correctly.

Rich snippets for products, events, articles, and reviews

Recipes are just one type of content that benefits from rich snippets. Here is what other common types look like and what information search engines typically display.

Product pages show the product name, price, currency, availability, and star rating. If you sell items on your website, adding product structured data helps search engines display the price and whether the item is in stock. The Schema.org type is "Product".

Event pages show the event name, date, time, location, and ticket price. If you promote concerts, conferences, classes, or other events, structured data helps people find the event details without visiting your page first. The type is "Event".

Article pages show the headline, publication date, author, and sometimes a thumbnail image. News sites and blogs use article structured data to help search engines understand the content and display it in news sections. The type is "Article" or "NewsArticle".

Review and rating pages show the reviewer's name, the rating, and the review text. If your site publishes reviews of products, restaurants, or services, structured data helps search engines display the star rating prominently. The type is "Review".

For each type, visit schema.org, search for the type name, and look at the list of recommended fields. Add the fields that match your content, test with the Rich Results Test, and publish.

Common mistakes to avoid when creating rich snippets

The most common mistake is adding structured data that does not match the visible content on your page. If your structured data says the recipe takes 30 minutes but the page text says 45 minutes, search engines will notice the mismatch and may not display the snippet. Always make sure the information in your structured data matches exactly what appears on the page.

Another mistake is using the wrong field names or misspelling them. JSON-LD is sensitive to spelling — if you write "recipeName" instead of "name" or "cookTime" instead of "cooktime", the test will fail. Copy field names directly from schema.org to avoid typos.

A third mistake is trying to create rich snippets for content that search engines do not support. Not every type of page has a corresponding rich snippet. Before you spend time writing structured data, check whether Google actually displays rich snippets for that content type. The Rich Results Test will tell you if your type is supported.

Finally, do not add structured data to pages where the information is not actually present. If your recipe page does not have a star rating, do not invent one in the structured data. Search engines check whether the data matches reality, and false information can hurt your search ranking.

Frequently Asked Questions

Do I need rich snippets to rank well in search results?

No. Rich snippets make your search result more attractive and clickable, but they do not directly affect whether your page ranks. A page without structured data can rank higher than a page with it. Rich snippets are a bonus that helps you stand out once you are already ranking.

Can I use a plugin to create rich snippets instead of writing the code myself?

Yes. If you use WordPress, plugins like Yoast SEO, Rank Math, and Schema Pro can generate JSON-LD code for you. You fill in a form with your recipe or product information, and the plugin writes the code. This is faster and less error-prone than writing code by hand, especially if you have many pages to mark up.

What happens if my structured data has errors?

Search engines will ignore the invalid code and treat your page as if there is no structured data. You will not be penalized for errors, but you also will not get the rich snippet. That is why testing with the Rich Results Test is important — it catches errors before you publish.

Can I add rich snippets to old pages, or only new ones?

You can add structured data to any page, whether it is brand new or years old. There is no penalty for adding structured data to existing content. In fact, going back and adding structured data to your most popular pages is a good strategy — those pages already have traffic, and rich snippets can increase clicks.

Do I need to add rich snippets in multiple formats, or just one?

One format is enough. You do not need to add JSON-LD and microdata and RDFa to the same page. Pick one — JSON-LD is the easiest — and use that consistently across your site.