Shopify Product Schema Generator
Generate a dynamic Product schema snippet for your Shopify theme. Instead of static values, it outputs Liquid that fills in each product’s title, description, price, variants and ratings automatically — one snippet covers your whole catalog.
Details
Advanced & recommended fields
Liquid code for your theme
Dynamic Shopify product schema, done right
Most schema tools output static JSON-LD for a single product. That doesn't scale on Shopify, where one main-product template renders thousands of products. This Shopify product schema generator instead builds a Liquid snippet: you paste it once, and Shopify fills in {{ product.title }}, the description, price, availability, variants and star ratings live for every product page.
How to add it to your theme
- Pick your pricing model and fill in your rating fields on the left. The Liquid updates instantly on the right.
- Copy the snippet and go to Online Store → Themes → Edit code.
- Open
layout/theme.liquidand paste the snippet just before the closing</head>tag. This works on every theme — including newer ones like Horizon that no longer ship asections/main-product.liquidfile. Because the snippet is wrapped in{% if template.name == 'product' %}, it only outputs on product pages even though it lives in the site-wide layout. - Save, then open a live product URL and test it in Google's Rich Results Test.
What the Liquid does
- Values are escaped safely with Shopify's
| jsonfilter, so quotes and special characters never break your JSON-LD. - Variants can be emitted as one
Offerper variant, a singleOffer, or aAggregateOfferprice range — whichever suits your products. - Availability switches between
InStockandOutOfStockper variant automatically. - Product-page only — the whole block is wrapped in
{% if template.name == 'product' %}, so it never fires on collection, cart or home pages.
Adding star ratings from your reviews app
Shopify has no built-in review system, so you supply the average rating and review count as Liquid expressions — normally the metafields your reviews app exposes. The fields are prefilled with Shopify's native product.metafields.reviews.rating metafields; replace them with your app's (for example a Judge.me, Loox or Yotpo metafield). The generator wraps the aggregateRating in {% if <review count> > 0 %} so it only ever renders when there are genuine reviews — never fabricated. Leave both fields blank to omit ratings entirely.
Avoiding duplicate markup
Because many Shopify themes already output some Product markup, paste a live product page's HTML into our schema validator first so you don't ship duplicate blocks. For the wider setup, see our Shopify schema markup guide, the standard Product schema generator, and how AggregateRating schema earns star results.