All articles
Technical SEO · · 7 min read

Shopify Product Schema: How to Check, Fix and Extend It

How Shopify themes output product structured data, how to test it, how to fix duplicate markup from review apps, and how to add the fields it leaves out.

A desk with a keyboard, cable, glasses, and a notebook.
On this page

Shopify product schema is JSON-LD code on your product pages that tells search engines the product name, price, availability and other facts in a machine-readable format. Most Shopify themes output it for you. The common problems are two competing Product blocks, usually from the theme and a review app, and missing fields such as GTIN. Fixing either starts with seeing exactly what your pages output today.

Structured data makes a page eligible for rich results such as price and availability in a listing. It does not guarantee them, and Google decides when to show them.

How Shopify outputs product schema by default

Modern themes such as Dawn do not contain a hand-written schema block. In Dawn's sections/main-product.liquid, the markup comes from one Liquid filter inside a JSON-LD script tag:

<script type="application/ld+json">{{ product | structured_data }}</script>

Per Shopify's reference, the filter outputs a schema.org Product for a product with no variants and a ProductGroup for a product with variants. Its documented example includes brand, category, description, image, name, and offers with price, currency, availability and URL. Older or customized themes may use a hand-written block instead, often in a snippet, so search your own theme files for ld+json to find where yours comes from.

How to see what your store outputs

  1. Open a product page, view the source and search for application/ld+json. Count the blocks that declare a Product.
  2. Paste the product URL into Google's Rich Results Test and open the Product and Merchant listings results. Use the product address, not a variant address.
  3. Run the page through the Schema Markup Validator to catch syntax errors.
  4. In Search Console, open the Product snippets and Merchant listings reports to see errors across the whole catalog.

Warnings, such as a missing GTIN, point to incomplete data. Errors, such as a missing price, can stop the rich result.

Fix duplicate schema from a review app and your theme

The most common error is two Product blocks on one page. The theme outputs one, and an app that adds star ratings (Yotpo, Judge.me, Loox and similar) outputs another. Often the theme's block has the product facts but no rating, and the app's block has the rating but few product facts. Search engines then see two product entities instead of one complete one.

Pick one source of truth:

  • Let the theme own it. Turn off the app's own structured data output in its settings. Most review apps have an option for this, and some can feed rating data into the theme's markup.
  • Let the app own it. If the app produces a complete Product block, remove the theme's structured_data line so only the app's block remains.

Whichever you choose, test again with the Rich Results Test and confirm only one Product is detected. If you have recently fixed the markup, use URL Inspection in Search Console to request recrawling of that URL.

Printed barcode labels emerging from a thermal printer on a desk.
Custom identifiers like MPNs and GTINs are crucial for valid product schema.

Add the fields the default output leaves out

Before touching code, fill in the data in your admin. Barcodes, SKUs and the vendor name are product data that identifiers are built from, so add them to your products, then retest to see whether they appear. Shopify's reference page does not list GTIN, SKU or ratings in its documented output, so test your own page rather than assuming.

If a field you need is still missing, the supported route is to replace the filter with your own JSON-LD block. You cannot add a line inside the output of structured_data, so remove the filter line and keep a single block. A minimal example that includes an MPN stored in a product metafield with the namespace custom and key mpn:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": {{ product.title | json }},
  "description": {{ product.description | strip_html | json }},
  "brand": { "@type": "Brand", "name": {{ product.vendor | json }} },
  {%- if product.metafields.custom.mpn.value != blank -%}
  "mpn": {{ product.metafields.custom.mpn.value | json }},
  {%- endif -%}
  "offers": {
    "@type": "Offer",
    "url": {{ shop.url | append: product.url | json }},
    "priceCurrency": {{ cart.currency.iso_code | json }},
    "price": {{ product.selected_or_first_available_variant.price | divided_by: 100.0 | json }},
    "availability": "{% if product.selected_or_first_available_variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}"
  }
}
</script>

This is a starting point, not a drop-in. Edit a duplicate of your live theme, add the fields your catalog needs, and validate the output on several products, including ones with variants and ones that are out of stock. A misplaced comma invalidates the whole block.

Keep it accurate

Structured data has to match what a visitor sees on the page. Prices, availability and reviews in the markup should be the same as the ones on screen. If you have a review app, make sure the reviews exist on the page and not only in the markup.

Check it at scale

Checking one product tells you about one template. SEO Karbon's free Shopify SEO audit looks at structured data on real product pages as part of 71 checks across 10 areas, with no login. For how schema fits into the rest of a product page, read the Shopify product page SEO guide, and for how variants affect what search engines see, see the variants guide. The full process is in how to do an SEO audit on Shopify.

Next step

See how your own store scores

The free audit checks your store against the issues in this article — indexation, duplicate collections, page speed and everything else that holds a Shopify store back — and shows you what to fix first.