New

50% off Shop Products & 50% off 1st Month of Retainer Packages. Terms apply*. Contact us to apply your discount.

How to add Schema Markup to Shopify

Last updated:

Kahunam Newsletter

Get quality content to grow your website. Sign up today for fresh ideas and inspiration.

As a subscriber, you'll have access to regular competitions with valuable prizes.

Home » Articles » Shopify » How to add Schema Markup to Shopify

How to Add Schema Markup to Shopify

Introduction

Schema markup is structured data that helps search engines understand your store’s content. By adding schema markup to your Shopify store, you can improve how your products appear in search results with rich snippets showing prices, reviews, and availability.

Modern Shopify themes like Dawn (v15.0+) now include built-in schema markup using the structured_data Liquid filter. Before adding custom schema, check if your theme already generates it to avoid duplication.

Schema markup has become critical with AI search engines and Google’s emphasis on structured data for e-commerce rich results.

How to Add Schema Markup to Your Shopify Store

Before You Start: Check Your Current Theme

Many Shopify themes already include basic schema markup. Dawn theme (v15.0+) includes comprehensive product schema using the structured_data filter.

To check existing schema:

  1. Visit Google’s Rich Results Test
  2. Enter your product page URL
  3. Review what structured data already exists

Important: If your theme uses the structured_data filter, manually adding schema may create duplicates.

Method 1: Using Shopify Apps (Easiest)

Best for: Non-technical users or stores needing automated schema management.

  1. Log in to your Shopify dashboard
  2. Go to the Shopify App Store
  3. Search for schema markup apps:
    • JSON-LD for SEO
    • Sherpas: Smart SEO
    • SEO Manager
    • Schema Plus for SEO
  4. Install and configure your chosen app
  5. Verify with Google’s Rich Results Test to ensure no duplicate schema

Warning: Verify your theme doesn’t already generate schema before using apps.

Method 2: Manual Implementation

Best for: Developers or stores needing custom schema control.

Step 1: Access Your Theme Code

  1. Log in to Shopify admin
  2. Navigate to Online Store > Themes
  3. Click Actions > Edit code

Step 2: Locate the Correct Template

For Dawn theme (v15.0+):

  • Check if structured_data filter is already in use in sections/main-product.liquid
  • If the filter exists, use Method 3 below to extend it

For other themes or custom implementation:

  • Product pages: sections/main-product.liquid or templates/product.liquid
  • Collection pages: sections/main-collection.liquid
  • Blog pages: sections/main-article.liquid

Step 3: Add JSON-LD Schema Markup

Place schema in the <head> section or just before the closing </body> tag.

For Products with Variants (Use ProductGroup):

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "{% if product.variants.size > 1 %}ProductGroup{% else %}Product{% endif %}",
  "name": "{{ product.title | escape }}",
  "description": "{{ product.description | strip_html | escape }}",
  "image": [
    "{{ product.featured_image | img_url: 'master' }}"
    {% for image in product.images limit: 5 %}
    ,"{{ image | img_url: 'master' }}"
    {% endfor %}
  ],
  "brand": {
    "@type": "Brand",
    "name": "{{ product.vendor | escape }}"
  },
  {% if product.variants.size > 1 %}
  "variesBy": [
    {% for option in product.options %}
    "{{ option | escape }}"{% unless forloop.last %},{% endunless %}
    {% endfor %}
  ],
  "hasVariant": [
    {% for variant in product.variants %}
    {
      "@type": "Product",
      "name": "{{ product.title | escape }} - {{ variant.title | escape }}",
      "sku": "{{ variant.sku | escape }}",
      "offers": {
        "@type": "Offer",
        "priceCurrency": "{{ shop.currency }}",
        "price": "{{ variant.price | money_without_currency | remove: ',' }}",
        "availability": "{% if variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
        "url": "{{ shop.url }}{{ product.url }}?variant={{ variant.id }}"
      }
    }{% unless forloop.last %},{% endunless %}
    {% endfor %}
  ],
  {% endif %}
  "offers": {
    "@type": "{% if product.variants.size > 1 %}AggregateOffer{% else %}Offer{% endif %}",
    "priceCurrency": "{{ shop.currency }}",
    {% if product.variants.size > 1 %}
    "lowPrice": "{{ product.price_min | money_without_currency | remove: ',' }}",
    "highPrice": "{{ product.price_max | money_without_currency | remove: ',' }}",
    {% else %}
    "price": "{{ product.price | money_without_currency | remove: ',' }}",
    {% endif %}
    "availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
    "url": "{{ shop.url }}{{ product.url }}"
  }
}
</script>

For Breadcrumbs:

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

For Organization (Site-wide):

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "{{ shop.name }}",
  "url": "{{ shop.url }}",
  "logo": "{{ shop.logo | img_url: 'master' }}"
}
</script>

Step 4: Validate Your Schema

  1. Save your changes
  2. Visit Google’s Rich Results Test
  3. Or use Schema Markup Validator for comprehensive validation
  4. Fix any errors before publishing

Method 3: Extending Dawn’s Built-in Schema (Dawn v15.0+)

If your Dawn theme already uses {{ product | structured_data }}, extend it rather than replace it:

<!-- Dawn's built-in schema -->
<script type="application/ld+json">
  {{ product | structured_data }}
</script>

<!-- Your additional schema (must use same @id) -->
<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@id": "/products/{{ product.handle }}#product",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "{{ product.metafields.reviews.rating }}",
    "reviewCount": "{{ product.metafields.reviews.count }}"
  }
}
</script>

This approach prevents conflicts with Dawn’s native schema generation.

Important Guidelines

Do’s:

  • Always validate with Rich Results Test before publishing
  • Use ProductGroup type for products with multiple variants (sizes, colors, etc.)
  • Include accurate, real product information only
  • Add reviews schema only if you have genuine customer reviews
  • Monitor Google Search Console > Enhancements regularly

Don’ts:

  • Never add fake reviews or ratings (Google penalizes this)
  • Don’t duplicate schema – check what exists first
  • Don’t use deprecated tools like “Structured Data Testing Tool” (retired in 2021)
  • Don’t add schema to products without proper inventory data

Conclusion

Adding schema markup to your Shopify store improves search visibility and helps customers find your products faster. For modern Dawn themes (v15.0+), leverage the built-in structured_data filter and extend it only when needed. For other themes, choose between apps for simplicity or manual implementation for control.

Remember to:

  • Check existing schema before adding more
  • Validate with Google’s Rich Results Test
  • Monitor performance in Google Search Console
  • Keep schema updated when products change

Need help implementing schema markup? Consider consulting with a Shopify expert or SEO professional to ensure proper implementation without errors or duplications.

Leave a comment

Why your website is not working?

We will assist you by sending helpful material once a month. Join the newsletter to receive what you need for your website.

Data processed subject to the Kahunam privacy policy.

Just posted

Become an expert website owner

Join our community of website professionals and learn how to achieve website success through our helpful newsletter.