Shopify Schema Markup: Complete Guide + JSON-LD Code

Shopify Schema Markup: Complete Guide + JSON-LD Code

December 30, 2024

Rich snippets drive 20-30% higher click-through rates in Google search results. Star ratings, pricing, availability badges — they all come from schema markup. But most Shopify stores either have broken schema, duplicate markup from conflicting apps, or no structured data beyond what their theme provides by default.

Shopify schema markup tells search engines (and AI systems like ChatGPT and Google AI Overviews) exactly what your products are, what they cost, and whether they're in stock. Without it, Google guesses. With it, you get richer search listings and cleaner data extraction.

This guide gives you working, copy-paste JSON-LD code for every schema type a Shopify store needs — plus a method for auditing what you already have before adding more.

Before you add anything, run a free JSON-LD audit to check your current schema for errors and duplicates. Adding new schema on top of broken markup creates more problems than it solves.

What Is Schema Markup (and Why Shopify Stores Need It)

Schema markup is structured data you add to your pages in a format search engines understand. Instead of parsing your HTML and guessing that "$34.99" is a price and "In Stock" means available, schema tells Google directly: this is a Product, it costs $34.99 USD, and it's available for purchase.

The format Google prefers is JSON-LD — a block of JavaScript you place in your page's <head> or <body>. It looks like this:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Organic Cotton Tee",
  "offers": {
    "@type": "Offer",
    "price": "34.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  }
}
</script>

Google reads this, validates it, and may display rich results — product cards with pricing, star ratings, and availability directly in search results.

For Shopify stores, schema markup matters for three reasons:

Rich results drive clicks. Product listings with star ratings, prices, and availability badges stand out in search results. Studies show 20-30% CTR improvement over plain blue links.

Google Merchant Center requires it. If you run Google Shopping, clean product schema reduces feed errors and improves listing quality. Missing or conflicting schema causes disapprovals.

AI systems use it. ChatGPT, Perplexity, and Google AI Overviews extract product data from structured markup. Proper schema improves how AI assistants represent your products — price accuracy, availability, and brand attribution all improve with clean JSON-LD.

Does Your Shopify Theme Already Have Schema?

Before adding any schema markup, check what's already there. Adding duplicate schema is one of the most common mistakes Shopify merchants make — and it causes Google Search Console errors.

Dawn Theme (v15.0+) Built-In Schema

If you're on Shopify's Dawn theme (or any Dawn-based theme), you already have Product and Organization schema built in. Dawn uses the structured_data Liquid filter to generate JSON-LD automatically.

How to check: View your product page source (right-click > View Page Source) and search for application/ld+json. If you see a <script type="application/ld+json"> block with Product data, your theme already outputs schema.

Check All Your Schema Sources

Schema can come from multiple places on a single page:

  1. Your theme (built-in or custom code)
  2. Shopify apps (SEO apps like JSON-LD for SEO, Schema Plus)
  3. Review apps (Judge.me, Yotpo, Loox — many inject their own schema)
  4. Google & YouTube channel (adds some markup automatically)

When two sources output Product schema for the same page, Google sees conflicting data and may ignore both. This is why auditing comes first.

💡 Pro Tip: Analytics Agent automatically tracks all these metrics for you. Install Analytics Agent and get instant insights without the manual work.

Decision Framework: What to Do Next

  • Dawn theme with built-in schema + no apps: Extend the existing schema (add FAQ, Breadcrumb, Reviews). Don't replace what works.
  • Dawn theme + schema app installed: Audit for duplicates. You likely have conflicting Product schema. Remove one source.
  • Custom or older theme with no schema: Add schema from scratch using the code library below.
  • Any theme + broken schema in Search Console: Fix errors first, then extend.

Essential Schema Types for Shopify

Not all schema types are equally valuable. Here's the priority order for ecommerce stores:

Schema Type Priority What It Enables Where to Use
Product Must-have Price, availability, reviews in search Every product page
Organization Must-have Brand knowledge panel, trust signals Homepage / site-wide
BreadcrumbList Should-have Breadcrumb trail in search results Product and collection pages
AggregateRating Should-have Star ratings in search results Products with reviews
FAQPage Nice-to-have Expanded FAQ results, PAA capture Product pages, FAQ page
ItemList Nice-to-have Product carousel potential Collection pages

Focus on Product and Organization first. Add Breadcrumb and Rating next. FAQ and ItemList come last. For a deeper dive into structured data for Shopify, see our priority framework guide.

How to Add Schema Markup to Shopify: 3 Methods

Method 1: Extend Dawn's Built-In Schema (Recommended for Dawn Users)

If your theme already outputs Product schema, extend it rather than replacing it. Use the same @id to add properties without creating duplicates.

Example: Adding review data to Dawn's product schema:

{% comment %}
  Extending Dawn's product schema with reviews
  Place in: snippets/schema-product-reviews.liquid
  Include with: {% render 'schema-product-reviews' %}
{% endcomment %}

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "@id": "{{ shop.url }}{{ product.url }}",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.8",
    "reviewCount": "124"
  }
}
</script>

The @id must match what Dawn already uses for the product. Google merges both JSON-LD blocks into one entity.

Pros: No conflicts with theme updates. Clean and minimal. Cons: Requires understanding @id matching.

Method 2: Manual Implementation (Custom or Older Themes)

If your theme has no built-in schema, add it from scratch using Liquid snippets.

Steps:

  1. Go to Online Store > Themes > Edit Code
  2. In the Snippets folder, create new files: schema-product.liquid, schema-organization.liquid, etc.
  3. Paste the code from the library below
  4. Include snippets in your templates:
    • Add {% render 'schema-organization' %} to theme.liquid
    • Add {% render 'schema-product' %} to your product template
  5. Test with Google's Rich Results Test

Pros: Full control, free, portable across themes. Cons: Manual updates when products or data change.

Method 3: Using a Shopify App

If you're not comfortable editing code, apps like JSON-LD for SEO ($19.99/mo) or Schema Plus handle schema automatically.

Pros: No coding, automatic updates, visual interface. Cons: Monthly cost ($10-30/mo), potential conflicts with theme schema, less control.

Critical warning: Apps often conflict with Dawn's built-in schema. If you install a schema app on a Dawn theme without removing the built-in markup first, you'll have duplicate Product schema on every product page. Always audit first.

Factor Manual Code Extend Dawn Apps
Technical skill Medium-High Medium Low
Cost Free Free $10-30/mo
Control Full High Medium
Duplicate risk Medium Low High
Best for Custom themes Dawn users Non-technical
🔍

See Analytics Agent in Action

Discover how AI-powered insights can transform your Shopify store.

Learn More →

Complete JSON-LD Code Library

Every code example below is tested, uses Shopify Liquid variables for dynamic data, and includes comments explaining each field. Copy, paste, and customize. For additional ready-to-use snippets, see our JSON-LD for Shopify code reference.

1. Product Schema (with Offers)

Place in: snippets/schema-product.liquid Include with: {% render 'schema-product' %} in your product template.

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "@id": "{{ shop.url }}{{ product.url }}",
  "name": "{{ product.title | escape }}",
  "description": "{{ product.description | strip_html | truncate: 500 | escape }}",
  "url": "{{ shop.url }}{{ product.url }}",
  "image": [
    {% for image in product.images limit: 5 %}
      "{{ image.src | img_url: 'grande' }}"{% unless forloop.last %},{% endunless %}
    {% endfor %}
  ],
  "brand": {
    "@type": "Brand",
    "name": "{{ product.vendor | escape }}"
  },
  "sku": "{{ product.selected_or_first_available_variant.sku }}",
  "offers": {
    "@type": "Offer",
    "url": "{{ shop.url }}{{ product.url }}",
    "priceCurrency": "{{ cart.currency.iso_code }}",
    "price": "{{ product.selected_or_first_available_variant.price | divided_by: 100.0 }}",
    "priceValidUntil": "{{ 'now' | date: '%s' | plus: 31536000 | date: '%Y-%m-%d' }}",
    "availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
    "itemCondition": "https://schema.org/NewCondition",
    "seller": {
      "@type": "Organization",
      "name": "{{ shop.name | escape }}"
    }
  }{% if product.metafields.reviews.rating %},
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "{{ product.metafields.reviews.rating }}",
    "reviewCount": "{{ product.metafields.reviews.count }}"
  }{% endif %}
}
</script>

Key fields:

  • @id — Unique identifier. Use the product URL so extensions can reference it.
  • image — Array of up to 5 images. Google prefers multiple angles.
  • priceValidUntil — Set to 1 year from now. Required for some rich result types.
  • aggregateRating — Only renders if review metafields exist (conditional).

For a field-by-field breakdown of every property, see our product schema for Shopify template guide.

2. Organization Schema

Place in: theme.liquid before </head>, or create snippets/schema-organization.liquid.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "{{ shop.name | escape }}",
  "url": "{{ shop.url }}",
  "logo": "{{ 'logo.png' | asset_url }}",
  "description": "{{ shop.description | escape }}",
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+1-555-555-5555",
    "contactType": "Customer Service",
    "email": "support@{{ shop.domain }}",
    "areaServed": "US",
    "availableLanguage": "English"
  },
  "sameAs": [
    "https://www.facebook.com/yourpage",
    "https://www.instagram.com/yourhandle",
    "https://twitter.com/yourhandle"
  ]
}
</script>

Replace the social profile URLs, phone number, and email with your actual details. The logo should be at least 112x112px and square.

3. Breadcrumb Schema

Place in: your product template or collection template.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "{{ shop.url }}"
    },
    {% if collection %}
    {
      "@type": "ListItem",
      "position": 2,
      "name": "{{ collection.title | escape }}",
      "item": "{{ shop.url }}{{ collection.url }}"
    },
    {% endif %}
    {
      "@type": "ListItem",
      "position": {% if collection %}3{% else %}2{% endif %},
      "name": "{{ product.title | escape }}",
      "item": "{{ shop.url }}{{ product.url }}"
    }
  ]
}
</script>

Position numbers must be sequential. Google displays the breadcrumb trail directly in search results, replacing the raw URL.

4. FAQ Schema

Place on product pages with Q&A sections, your FAQ page, or blog posts. For the complete implementation guide, see FAQ schema for Shopify.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What materials are used?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Our products are made from 100% organic cotton sourced from sustainable farms. All materials are GOTS certified."
      }
    },
    {
      "@type": "Question",
      "name": "How long is shipping?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Standard shipping takes 5-7 business days. Express shipping (2-3 days) is available at checkout."
      }
    },
    {
      "@type": "Question",
      "name": "What is your return policy?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "We offer 30-day free returns. Items must be unworn and in original packaging."
      }
    }
  ]
}
</script>

Keep it to 3-5 questions per page. FAQ schema can trigger expanded results in Google, giving you more SERP real estate.

5. Collection Page (ItemList) Schema

Place in: collection.liquid or your collection template.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ItemList",
  "url": "{{ shop.url }}{{ collection.url }}",
  "numberOfItems": {{ collection.products.size }},
  "itemListElement": [
    {% for product in collection.products limit: 20 %}
    {
      "@type": "ListItem",
      "position": {{ forloop.index }},
      "item": {
        "@type": "Product",
        "name": "{{ product.title | escape }}",
        "url": "{{ shop.url }}{{ product.url }}",
        "image": "{{ product.featured_image.src | img_url: 'large' }}"
      }
    }{% unless forloop.last %},{% endunless %}
    {% endfor %}
  ]
}
</script>

Limit to 20 products per collection. Google may display these as product carousels.

Finding and Fixing Duplicate Schema

Duplicate schema is the number one Shopify structured data problem. It happens when your theme, an SEO app, and a review app all output Product schema on the same page.

How to Detect Duplicates

Method 1: View Page Source. Go to a product page, view source, and search for application/ld+json. Count how many Product schema blocks you find. If there's more than one, you have duplicates.

Method 2: Google Rich Results Test. Paste your product page URL into Google's Rich Results Test. It shows every detected schema entity. Multiple Product entries = duplicates.

Method 3: Automated audit. Run a JSON-LD audit to scan your entire site and flag duplicate, conflicting, or malformed schema across all pages.

💡 Pro Tip: Analytics Agent automatically tracks all these metrics for you. Install Analytics Agent and get instant insights without the manual work.

How to Fix Duplicates

  1. Identify all sources. Check your theme code, installed apps (Settings > Apps), and the Google & YouTube channel.
  2. Pick one source. Keep the most complete implementation.
  3. Remove the others. If an app creates duplicates with your theme, either disable the app's schema output or remove the theme's built-in markup.
  4. Re-validate. Run the Rich Results Test again after changes.

For Dawn themes specifically: if you install a schema app, you often need to remove Dawn's structured_data output from the theme files. Otherwise both the app and the theme produce Product schema.

Validating Your Schema

After adding or modifying schema, always validate.

Google Rich Results Test: search.google.com/test/rich-results — Shows which rich result types your page qualifies for. Fix any errors (red) and warnings (yellow).

Schema Markup Validator: validator.schema.org — Validates against the full Schema.org vocabulary. More detailed than Google's tool.

Google Search Console: After deployment, monitor Enhancements > Products (and other schema types) for crawl-level errors across your entire site.

Important: Valid schema does not guarantee rich results. Google decides whether to display rich snippets based on many factors including domain authority, page quality, and search intent. Schema improves your eligibility — it doesn't guarantee anything. Learn more about what determines rich results eligibility.

Schema for AI Search Optimization

AI assistants like ChatGPT, Perplexity, and Google's AI Overviews use structured data to understand your products. Clean schema markup improves accuracy when AI systems describe your products — correct pricing, availability, and brand attribution.

This matters beyond traditional SEO. When someone asks ChatGPT "what's a good organic cotton t-shirt under $40?", structured data helps the AI extract your product details accurately. Without schema, AI systems fall back on HTML parsing, which is less reliable.

Three things to prioritize for AI readability:

  1. Complete Product schema with accurate pricing and availability
  2. Organization schema with your brand name and description
  3. FAQ schema on product pages — AI systems love question/answer pairs

For deeper coverage on how AI search affects your store, see our guide on structured data for Shopify.

FAQ

Does Shopify have built-in schema markup?

Yes. Shopify's Dawn theme (v15.0+) and Dawn-based themes include Product and Organization schema automatically. Older or custom themes may not. Check by viewing your page source and searching for application/ld+json.

Will schema markup guarantee rich snippets?

No. Schema improves your eligibility for rich results, but Google decides whether to display them based on domain authority, content quality, and search context. Focus on valid, complete markup and monitor results in Search Console over 4-6 weeks.

Can I add schema markup without coding?

Yes, through Shopify apps like JSON-LD for SEO or Schema Plus. But be aware that apps can create duplicate schema if your theme already includes built-in markup. Always audit your existing schema before installing an app.

How do I know if my schema is working?

Use Google's Rich Results Test to validate individual pages. Monitor Google Search Console's Enhancements reports for site-wide issues. Both are free. For automated monitoring, run a JSON-LD audit to check all pages at once.

What's the difference between JSON-LD, Microdata, and RDFa?

All three are formats for structured data. Google recommends JSON-LD because it's a separate script block that doesn't interfere with your HTML. Microdata and RDFa are embedded in your HTML tags, making them harder to maintain and more prone to breaking during theme updates.

How often should I update my schema?

Product schema updates automatically through Liquid variables (price, availability, title). Organization schema only needs updating when your business details change. Review schemas should update when your review count or rating changes — most review apps handle this automatically.

Next Steps

Start with an audit. Knowing what schema your store already has prevents the most common mistake — adding duplicate markup that creates more errors than it fixes.

  1. Run a free JSON-LD audit to see your current state
  2. Fix any errors or duplicates flagged
  3. Add missing schema types using the code library above, starting with Product and Organization
  4. Validate with Google's Rich Results Test
  5. Monitor Search Console Enhancements reports over the next 4-6 weeks

For related setup guides, check our GA4 setup guide for Shopify or learn how to understand your Shopify analytics.

Ready to Unlock Your Analytics Potential?

Connect Analytics Agent to your Shopify store and start making data-driven decisions today.

Get Started Free