Short answer: JSON-LD is better for Shopify. Google supports both formats equally for rich results, but recommends JSON-LD, and on Shopify it is easier to maintain: it sits in one block that reads values from Liquid, it survives layout changes, and it is the only format an app can add through an app embed. If your theme still uses microdata, either keep it and add nothing that duplicates it, or replace it with JSON-LD. Never run both for the same product.
What Google says
Google's introduction to structured data lists JSON-LD, Microdata and RDFa as supported formats and recommends JSON-LD. A complete, valid Product described in microdata is just as eligible for product rich results as the same Product in JSON-LD. So this is not a choice between a format that works and one that does not. It is a choice about which one is easier to get right and keep right on your store.
For a side-by-side of the formats themselves, with code for each, see what is JSON-LD? This page is about the Shopify decision.
Why JSON-LD suits a Shopify store
| On Shopify | JSON-LD | Microdata |
|---|---|---|
| Where the code lives | One block, usually in the product section or an app embed | Spread across the HTML of the product template |
| Theme customisation | Moving sections and blocks does not affect it | Removing or reordering a block can remove a property |
| Added by an app | Yes, through an app embed, no theme edits | No, it has to be woven into theme HTML |
Linking blocks with @id | Easy | Possible but awkward |
Shopify's structured_data filter | Outputs JSON-LD | Not applicable |
The deciding point on Shopify is that themes change. Merchants move sections in the theme editor, apps add blocks, and theme updates replace files. Microdata depends on the exact HTML of the template, so every change risks dropping a property. A JSON-LD block reads values straight from Liquid objects, so the layout can change around it:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": {{ product.title | json }},
"url": {{ request.origin | append: product.url | json }}
}
</script>
Many current themes, including Dawn, output Product as JSON-LD using Shopify's structured_data filter.
If your theme still uses microdata
Some older themes, and some app widgets, still output microdata. To check, view the source of a product page and search for itemscope and itemprop as well as application/ld+json. You then have two sensible options:
- Keep the microdata if it is complete and valid in the Rich Results Test, and make sure nothing else adds a second Product. This is fine; Google reads it.
- Replace it with JSON-LD. On a duplicate of your theme, remove the
itemscope,itemtypeanditempropattributes for the Product and its Offer, then add a single JSON-LD block from the theme or an app. Test the duplicate before publishing it.
The mistake to avoid: installing a schema app that adds JSON-LD while the theme's microdata stays in place. Google reads both formats, so the page now has two Product items, often with different prices or availability. It looks like one set of markup in the code but counts as two. See duplicate Product schema.
Server-rendered JSON-LD beats JavaScript-injected JSON-LD
One more distinction matters more on Shopify than the format question. JSON-LD can be in the page HTML (written by the theme's Liquid or an app embed) or injected by a script after the page loads. Google can read JSON-LD that is added with JavaScript, but only after it renders the page, which can happen later than the first crawl and is less predictable. JSON-LD in the HTML is read straight away, and you can see it with View Source.
Schema Clinic's audit checks both: it reads the rendered pages and, with Deep Scan, catches JSON-LD that apps inject with JavaScript, and it flags microdata and JSON-LD that duplicate each other. On Pro ($19.99/month) its generated JSON-LD is output with the page through the "Schema Clinic" app embed, with no theme code edited. Starter is $9.99/month; there is no free plan or trial.