Shopify Schema Integration
Shopify themes render HTML through Liquid templates. Add JSON-LD in theme.liquid or section-specific templates, binding product and shop fields to Schema.org properties.
Schema types by template
| Template | Type | Liquid sources |
|---|---|---|
product.liquid | Product | product.title, product.featured_image, product.price |
index.liquid or theme settings | Organization | shop.name, shop.url, social links |
| All pages | BreadcrumbList | request.page_type, collection/product titles |
Product page example
Generate the structure with the Schema Generator, then map Shopify fields:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": {{ product.title | json }},
"image": {{ product.featured_image | image_url: width: 1200 | json }},
"offers": {
"@type": "Offer",
"price": {{ product.price | divided_by: 100.0 | json }},
"priceCurrency": {{ cart.currency.iso_code | json }},
"availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}"
}
}
</script>
Add aggregateRating only when review stars are visible on the product page.
Implementation steps
- Online Store → Themes → Edit code
- Open the template for your target page type
- Paste JSON-LD before
</head>or in a dedicated snippet included in the head - Replace static values with Liquid variables
- Test a live product URL in Google Rich Results Test
- Check Google Search Console for product structured data errors
Tips
- Use snippets (
snippets/schema-product.liquid) to keep templates readable - Avoid duplicating JSON-LD if an SEO app already outputs Product schema
- Keep one Product object per product URL
- Update markup when you change currency or availability logic
See CMS Integrations for the general validation workflow.
