When someone searches for a product on Google, some results show star ratings, price, and availability right in the listing. Those are rich snippets, and they come from structured data on your product page. Without it, Google shows a plain blue link.
Shopify product schema markup tells search engines exactly what your product is, what it costs, and whether it is in stock. Adding it correctly can increase click-through rates by 20-30%. Here is how to generate it and add it to your store.
In this post
- What is JSON-LD product schema?
- Why schema markup matters for Shopify stores
- What Shopify includes by default
- How to generate product schema
- Adding JSON-LD to your Shopify theme
- Testing your schema markup
- Common schema mistakes to avoid
- Frequently asked questions
- Related reading
What is JSON-LD product schema?
JSON-LD (JavaScript Object Notation for Linked Data) is a format for adding structured data to web pages. It sits inside a <script> tag in your page’s HTML and is invisible to customers. Search engines read it to understand your page content.
For products, the Product schema type tells Google the product name, description, price, currency, availability, brand, images, and review ratings. Google uses this data to generate rich snippets – those enhanced search results with stars, prices, and stock status.
Here is a simple example:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Classic Leather Messenger Bag",
"image": "https://example.com/bag.jpg",
"brand": {"@type": "Brand", "name": "Your Brand"},
"offers": {
"@type": "Offer",
"price": "89.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock"
}
}
Google supports three formats for structured data: JSON-LD, Microdata, and RDFa. Google recommends JSON-LD because it is the easiest to add and maintain. It does not mix with your HTML, so it is less likely to break when you update your theme.
Why schema markup matters for Shopify stores
Rich snippets stand out on the search results page. A listing that shows a 4.8-star rating, “$49.99”, and “In Stock” gets more clicks than a plain text result. Studies from Search Engine Land show that rich results can increase CTR by 20-30% compared to standard listings.
Schema also feeds into AI search. ChatGPT, Perplexity, and Google AI Overviews parse structured data when recommending products. If your store has clean schema markup, AI systems can extract product details more accurately. This matters more every month as AI-driven shopping grows.
Beyond visibility, schema helps Google understand variant-level details. If you sell a shirt in 5 colors and 4 sizes, proper schema tells Google each combination’s price and availability. This is especially important for Google Shopping feed accuracy.
What Shopify includes by default
Most Shopify themes include basic Product schema out of the box. Dawn and other free themes output JSON-LD with product name, description, price, availability, and the featured image. But the default markup is often incomplete.
Common gaps in default Shopify schema:
- Missing
brandproperty (Google flags this as a warning) - No
aggregateRatingeven when you have review app data - Single offer instead of per-variant offers
- Missing
gtinorskuidentifiers - No
reviewmarkup for individual reviews
These gaps mean your products may not qualify for rich snippets. You can check what your theme currently outputs by running your product URL through the CraftShift Schema Generator or Google’s Rich Results Test.
How to generate product schema
You have three options for generating JSON-LD product schema for your Shopify store.
Option 1: Use a schema generator tool
The CraftShift Schema Generator lets you paste your product URL and generates complete JSON-LD markup. It fills in the brand, all variants as separate offers, images, and availability. Copy the output and paste it into your theme.
This works well if you have a small catalog and want to add schema to specific products manually. For stores with hundreds of products, you will want the Liquid template approach below.
Option 2: Edit your Shopify theme’s Liquid template
The best long-term solution is to add dynamic JSON-LD to your product template. This generates schema automatically for every product using Liquid variables.
Go to Online Store > Themes > Edit Code. Find your product template (usually sections/main-product.liquid or templates/product.liquid). Add a JSON-LD block at the bottom that pulls data from the product object:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": {{ product.title | json }},
"description": {{ product.description | strip_html | truncate: 500 | json }},
"image": {{ product.featured_image | image_url: width: 1024 | json }},
"brand": {
"@type": "Brand",
"name": {{ product.vendor | json }}
},
"sku": {{ product.selected_or_first_available_variant.sku | json }},
"offers": [
{% for variant in product.variants %}
{
"@type": "Offer",
"name": {{ variant.title | json }},
"price": {{ variant.price | money_without_currency | json }},
"priceCurrency": {{ cart.currency.iso_code | json }},
"availability": "https://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
"url": "{{ shop.url }}/products/{{ product.handle }}?variant={{ variant.id }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}
</script>
This template dynamically outputs every variant as a separate offer. Google can then show the correct price and availability for each variant in search results.
Option 3: Use a Shopify SEO app
Apps like Smart SEO, JSON-LD for SEO, and SEO Manager add schema automatically. They handle edge cases like review integration and multi-currency stores. The downside is an additional app on your store, which adds to cost and can affect page load speed.
For most stores, the Liquid template approach gives you the best balance of control and automation without the overhead of another app.
Adding JSON-LD to your Shopify theme
Step-by-step instructions for the Liquid template method:
Step 1: Go to Shopify Admin > Online Store > Themes. Click the three dots on your current theme and select “Edit code.”
Step 2: Search for your product template. In Dawn and most OS 2.0 themes, it is sections/main-product.liquid. In older themes, check templates/product.liquid.
Step 3: Scroll to the bottom of the file. Before the closing {% schema %} tag (in sections) or at the end of the file (in templates), paste your JSON-LD block.
Step 4: Check for duplicate schema. Some themes already output Product schema in snippets/structured-data.liquid or similar files. If you add a second one, Google may flag conflicting data. Search your theme files for “schema.org/Product” to find existing markup. Remove the old one or update it instead of adding a duplicate.
Step 5: Save and test on a live product page. Use the CraftShift SEO Checker to verify your page has valid structured data.
Testing your schema markup
After adding schema, validate it with these tools:
Google Rich Results Test (search.google.com/test/rich-results) – Enter your product URL. Google shows whether your page qualifies for rich snippets and flags any errors or warnings. This is the most important test because it shows what Google actually sees.
Schema Markup Validator (validator.schema.org) – Tests against the full schema.org spec. More strict than Google’s test. Useful for catching missing recommended properties.
Google Search Console – After a few days, check the “Enhancements” section. Google reports Product schema issues here at scale across your entire site. This is where you will see if any pages have errors.
Run the Rich Results Test on at least 3-4 different products. A product with reviews, a product without reviews, a product with variants, and a simple product. Each may have different schema issues. For a broader check of your store’s technical SEO, use the SEO Checker tool.
Common schema mistakes to avoid
Duplicate Product schema. If your theme already outputs schema and you add another block, Google sees conflicting data. Always check for existing schema first.
Missing brand property. Google recommends including brand. In Shopify, the product vendor is the natural mapping. If you leave your vendor as your store name on every product, Google may still flag it, but at least the field is present.
Hardcoded prices. If you paste a static JSON-LD block with a fixed price, it will become wrong the moment you change the price. Always use Liquid variables (variant.price) so the schema stays in sync with your actual product data.
Wrong availability status. A product marked as “InStock” in schema but actually sold out creates a bad user experience and may trigger a Google penalty. Use Liquid’s variant.available to set this dynamically.
Review markup without actual reviews. Adding aggregateRating with zero reviews or fake data violates Google’s guidelines. Only include review markup if you have real, verified customer reviews. Most Shopify review apps (Judge.me, Loox, Stamped) add their own review schema automatically.
Your product images also play a role in how Google displays your rich snippets. Make sure your featured image and variant images are high quality and properly tagged with alt text. The image URL in your schema should point to a real, accessible image.
Structured data is one piece of a larger SEO strategy. For a complete view of what else to optimize, check the product page optimization checklist.
Proper schema markup gets your products into rich snippets. But the product page itself still needs to convert. Clean variant images, accurate swatches, and fast load times work together with structured data to drive both clicks and sales. Rubik Variant Images handles the image side – showing only the right photos for each selected variant.
Frequently asked questions
Does Shopify add product schema automatically?
Most Shopify themes include basic Product schema. But the default markup often misses brand, review data, per-variant offers, and product identifiers like GTIN or SKU. You should check your theme’s output and fill the gaps.
What is the difference between JSON-LD, Microdata, and RDFa?
All three are formats for structured data. JSON-LD uses a script tag and is separate from your HTML. Microdata and RDFa add attributes directly to HTML elements. Google recommends JSON-LD because it is easier to maintain and less likely to break during theme updates.
Will adding schema guarantee rich snippets in Google?
No. Schema makes your page eligible for rich snippets, but Google decides whether to show them. Pages with valid, complete schema, good content, and established domain authority are more likely to get rich results.
How do I add review stars to my product schema?
Most Shopify review apps (Judge.me, Loox, Stamped, Yotpo) add aggregateRating and review schema automatically. If yours does not, you can add the markup manually using Liquid and your review app’s metafield data. Never add fake or placeholder review data.
Can I have both Product and FAQPage schema on the same page?
Yes. Google supports multiple schema types on one page. Adding FAQPage schema to your product page can earn you an additional rich result with expandable FAQ answers. Each schema type goes in its own script block.
How long does it take for rich snippets to appear after adding schema?
It typically takes a few days to a few weeks. Google needs to recrawl your page and process the structured data. You can speed this up by requesting indexing in Google Search Console for specific product URLs.
Does schema markup affect SEO rankings directly?
Schema is not a direct ranking factor. But rich snippets increase click-through rates, which can indirectly improve rankings over time. Schema also helps AI search systems understand and recommend your products.





