What rich snippets are and why they matter
Rich snippets are structured data that tell search engines what your page content means, so they can display extra information in search results — like star ratings, prices, cooking times, or event dates. Instead of showing only a title and description, search engines can pull specific details from your page and format them visually.
When someone searches for a recipe, a rich snippet might show the prep time and number of calories alongside the link. For a product, it might display the price and customer rating. This extra information makes your result stand out and gives searchers a reason to click before they even visit your page.
Search engines read rich snippets using structured data — code you add to your HTML that labels what each piece of content is. The most common format is Schema.org markup, which Google, Bing, and other engines recognize. Without it, search engines have to guess what your content means.
Key Takeaways
- Rich snippets use Schema.org structured data to label what your content is — a recipe, product, event, article, or review — so search engines can display extra details in results.
- You add structured data directly to your HTML using JSON-LD, Microdata, or RDFa format, with JSON-LD being the easiest for most websites.
- Google Search Console's Rich Results Test shows you whether your markup is correct and what snippet Google will display.
- Not every page type gets a rich snippet in search results — Google shows them only for formats it supports, like recipes, products, reviews, and events.
- Structured data helps search engines understand your content but does not directly change your ranking position.
The three ways to add structured data
You can write structured data in three formats, all of which search engines understand. JSON-LD is the simplest and most common for new websites — you paste a block of code into your page's HTML head or body, and it does not touch your visible content. Microdata uses HTML attributes sprinkled throughout your page to label specific elements. RDFa is similar to Microdata but uses a different syntax and is less common on modern websites.
For most people, JSON-LD is the right choice. It keeps your structured data separate from your HTML, so you can add or change it without breaking your page layout. If you use a website builder like WordPress, Shopify, or Wix, many have plugins or built-in tools that generate JSON-LD for you — you do not have to write code by hand.
If you do write it yourself, you can use Google's Schema.org Markup Generator or similar tools to create the code, then paste it into your page. The code looks like a block of text wrapped in <script type="application/ld+json"> tags.
How to write JSON-LD structured data
JSON-LD uses a simple text format that describes your content as a series of properties and values. For a recipe page, you would list the recipe name, ingredients, cooking time, and yield. For a product page, you would list the product name, price, availability, and rating.
Here is the basic structure for a recipe:
<script type="application/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": "Mix butter and sugar together." }, { "@type": "HowToStep", "text": "Add flour and mix well." } ] } </script>
The "@context" and "@type" fields tell search engines what kind of content this is. The other fields describe the specific details. Times use ISO 8601 format — PT15M means 15 minutes, PT1H30M means 1 hour 30 minutes.
Schema.org has templates for dozens of content types: articles, events, local businesses, job postings, breadcrumbs, and more. Visit schema.org to find the template for your content type, then fill in the fields that apply to your page.
Testing your structured data before publishing
Before you publish your page, test your structured data using Google's Rich Results Test. Paste your page URL or the HTML code itself, and Google will tell you whether the markup is correct, what errors exist, and what rich snippet it will display in search results.
If Google finds errors, it will point to the exact line and explain what is wrong — usually a missing required field, a typo, or a value in the wrong format. Fix these before publishing, because search engines will ignore broken markup.
You can also use Google Search Console to monitor rich results across your entire website. After you publish pages with structured data, Search Console will show you how many pages have valid markup, which ones have errors, and whether Google is displaying rich snippets for them in search results.
Which content types get rich snippets in search results
Google supports rich snippets for specific content types, and the list changes over time. Currently, Google shows rich snippets for recipes, products, reviews, articles, events, job postings, breadcrumbs, FAQs, how-to guides, and a few others. If your page is a different type — say, a blog post about a topic that is not an article, or a custom content type — Google may not display a rich snippet even if your markup is correct.
Check Google's Search Gallery to see which rich result types are currently supported and what fields are required for each. Just because you add structured data does not mean a rich snippet will appear — Google decides whether to show one based on the content type and whether it meets Google's quality guidelines.
Even if your page does not get a rich snippet in search results, structured data still helps. Search engines use it to understand your content better, which can improve how they categorize and rank your pages.
Common mistakes to avoid
The most common mistake is adding structured data that does not match your actual page content. If your page is a product review but you mark it up as a product, Google will notice the mismatch and may ignore the markup or penalize your site. Mark up only what is actually on the page.
Another mistake is using the wrong data type. If you have a recipe, use the Recipe type — not Article or CreativeWork. Schema.org has specific types for specific things, and using the wrong one confuses search engines.
A third mistake is leaving out required fields. Each content type has a list of required and recommended fields. If you skip required fields, Google will flag it as an error and may not display a rich snippet. Check the Schema.org documentation for your content type to see what is required.
Finally, do not add structured data just to manipulate search results. Google's guidelines say your markup must accurately describe your content. If you mark up fake ratings, false prices, or misleading information, Google can penalize your site.
Tools that generate structured data for you
If you use WordPress, plugins like Yoast SEO, Rank Math, and All in One SEO can generate structured data automatically based on your page content. You fill in a form, and the plugin writes the JSON-LD for you.
If you use Shopify, WooCommerce, or another e-commerce platform, product structured data is usually built in — you do not have to add it yourself. Check your platform's documentation to see what is included by default.
For custom websites, Google's Schema Markup Generator walks you through the fields for your content type and creates the code. Schema.org's markup generator and third-party tools like Merkle's Structured Data Markup Helper do the same thing.
Frequently Asked Questions
Does adding rich snippets improve my search ranking?
Structured data itself does not directly affect ranking — Google has said so publicly. However, rich snippets can increase click-through rate because they make your result more visually appealing and informative. Higher click-through can indirectly help ranking. The main benefit is that search engines understand your content better.
Can I add structured data to pages that are not yet published?
Yes, you can add structured data before publishing. In fact, you should test it before going live. Use Google's Rich Results Test on your staging site or local version, fix any errors, then publish. This way, the markup is correct from day one.
What if Google does not show a rich snippet for my page even though the markup is correct?
Google decides whether to display a rich snippet based on content type, quality, and relevance. Even with correct markup, Google may not show one if the content does not meet its guidelines or if the search query does not call for that type of result. Structured data still helps search engines understand your page, even if no snippet appears.
Do I need different structured data for mobile and desktop?
No. Use the same structured data for both. Google crawls and indexes mobile pages the same way it does desktop pages, and it reads the same markup on both versions.
Can I use structured data for content that is behind a paywall?
Yes, but mark it up accurately. If your article requires a subscription, use the Article type and include the "isAccessibleForFree": false property. Google will understand that the full content is not free, and it may show a different snippet or label in search results.