Why Shopify's Default Schema Isn't Enough

Shopify generates some schema markup automatically, particularly basic product schema on product pages. But it's minimal. It typically only includes the product name and URL, leaving out star ratings, price, availability, brand, SKU, and review counts the fields that actually make your products stand out in Google search results.

Beyond product pages, Shopify generates almost no schema for your homepage, collection pages, blog posts, or About page. This means you're leaving rich results, event cards, breadcrumbs, FAQ dropdowns, and organisation Knowledge panel signals completely untapped.

The good news: Shopify's Liquid templating system makes it straightforward to inject custom JSON-LD anywhere in your store. You don't need an app, and you don't need to pay for anything.

â„šī¸
Before you start: Always duplicate your theme before making edits. In your Shopify admin, go to Online Store → Themes → ⋯ → Duplicate. Work on the duplicate first, then publish when you're happy. This gives you a safe rollback if anything goes wrong.

3 Methods Compared

There are three main ways to add schema markup to Shopify. Choose based on where you need the schema and how much control you want:

Method Best for Requires Liquid? Dynamic data? Difficulty
theme.liquid (global) Homepage, site-wide schema (WebSite, Organization) Yes Yes Easy
Section / template files Product pages, collection pages, blog posts Yes Yes Moderate
Page content (HTML block) One-off pages (About, FAQ, Contact) No No Easy
💡
Recommendation: Start with Method 1 (theme.liquid) to add WebSite and Organization schema to your homepage. Then use Method 2 to add rich Product schema with dynamic Liquid variables to your product template. Method 3 is quickest for one-off pages.

Method 1: Adding Schema to theme.liquid (Global)

The theme.liquid file is the master layout file that wraps every page on your Shopify store. Any code you add here appears on every page. This is the right place for site-level schema like WebSite and Organization, which only need to appear on the homepage.

1
Open the theme code editor

In your Shopify admin, navigate to Online Store → Themes. Find your active theme (or your duplicate), click the ⋯ menu → Edit code. This opens Shopify's built-in code editor.

2
Open theme.liquid

In the left sidebar under Layout, click theme. liquid. This is your store's master template. Find the closing </head> tag; you'll paste your schema just before it.

3
Paste your WebSite + Organization schema

Copy the code below and paste it immediately before the closing </head> tag. Replace the placeholder values with your actual store details. The {% if request.page_type == 'index' %} tag ensures this only outputs on the homepage.

theme.liquid — paste before </head>
{% if request.page_type == 'index' %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "{{ shop.name }}",
  "url": "{{ shop.url }}",
  "potentialAction": {
    "@type": "SearchAction",
    "target": {
      "@type": "EntryPoint",
      "urlTemplate": "{{ shop.url }}/search?q={search_term_string}"
    },
    "query-input": "required name=search_term_string"
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "{{ shop.name }}",
  "url": "{{ shop.url }}",
  "logo": "YOUR_LOGO_URL_HERE",
  "sameAs": [
    "YOUR_TWITTER_URL",
    "YOUR_FACEBOOK_URL",
    "YOUR_INSTAGRAM_URL"
  ]
}
</script>
{% endif %}

Click Save in the top right. The {{ shop.name }} and {{ shop.url }} are Liquid variables. Shopify replaces them automatically with your actual store name and URL.

Method 2: Rich Product Schema in product.liquid

This is the most valuable schema for any Shopify store. Adding a full product schema with price, availability, brand, SKU, and ratings to your product template can unlock rich product results in Google, including star ratings and pricing shown directly in search listings.

âš ī¸
Check first: Before adding this code, check whether your theme already outputs Product schema. In your browser, right-click on a product page → View Page Source, and search for application/ld+json. If you see a Product schema block, read it carefully. You may need to modify the existing code rather than add a new block, to avoid duplicate schema errors.
1
Open your product template file

In the code editor, look under Templates for one of these files depending on your theme version:

  • Older themes: product.liquid
  • Dawn / newer themes: product.json (references sections) open main-product.liquid under Sections instead

Scroll to the very top of the file and paste your schema block at the beginning, before any other output.

2
Paste the full Product schema with Liquid variables

This schema uses Liquid variables to dynamically populate every field with your actual product data; no manual editing is required per product.

product.liquid or main-product.liquid — top of file
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "{{ product.title | escape }}",
  "description": "{{ product.description | strip_html | truncate: 300 | escape }}",
  "url": "{{ shop.url }}{{ product.url }}",
  "image": "{{ product.featured_image | img_url: 'master' }}",
  "sku": "{{ product.selected_or_first_available_variant.sku | escape }}",
  "brand": {
    "@type": "Brand",
    "name": "{{ product.vendor | escape }}"
  },
  "offers": {
    "@type": "Offer",
    "url": "{{ shop.url }}{{ product.url }}",
    "priceCurrency": "{{ cart.currency.iso_code }}",
    "price": "{{ product.selected_or_first_available_variant.price | money_without_currency | remove: ',' }}",
    "availability": "https://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
    "priceValidUntil": "{{ 'now' | date: '%s' | plus: 2592000 | date: '%Y-%m-%d' }}",
    "seller": {
      "@type": "Organization",
      "name": "{{ shop.name | escape }}"
    }
  }
}
</script>

All the {{ }} tags are Liquid. Shopify replaces them with real product data at render time. The priceValidUntil field is set to 30 days from now automatically.

3
Add aggregate rating (optional but high-impact)

If your store has a reviews app (Judge.me, Yotpo, Okendo, Loox, etc.) that exposes review data as Liquid variables, you can include an aggregateRating block in your Product schema. Star ratings in search results are one of the highest-CTR rich results available.

Add this block inside your Product schema JSON, after the offers block:

Add inside Product schema — after "offers" block
// Example using Judge.me Liquid variables adjust for your reviews app
{% if product.metafields.reviews.rating.value != blank %},
"aggregateRating": {
  "@type": "AggregateRating",
  "ratingValue": "{{ product.metafields.reviews.rating.value }}",
  "reviewCount": "{{ product.metafields.reviews.rating_count.value }}",
  "bestRating": "5",
  "worstRating": "1"
}
{% endif %}

Check your reviews app's documentation for the exact Liquid variable names; they vary between apps. Judge.me uses product. metafields.reviews. rating.value; Yotpo and others use different paths.

Generate perfect Product schema in seconds

Use our free Product Schema Generator: fill the form, copy the output, and paste into Shopify.

Open Product Generator →

Method 3: Static Schema in Page Content

For one-off pages like your About page, Contact page, or FAQ page, the simplest approach is pasting a <script> block directly into the page content in Shopify's page editor.

1
Generate your schema with Schemify

Use the appropriate Schemify generator for your page type:

Fill in the form and copy the generated JSON-LD output including the <script type="application/ld+json"> tags.

2
Paste into Shopify's page editor (HTML view)

In your Shopify admin, go to Online Store → Pages and open the page you want to add schema to. In the content editor, click the <> Source code button (or "Show HTML" depending on your editor version) to switch to HTML view.

Paste your schema <script> block at the very beginning of the HTML content area, before any visible content. Click Save.

💡
Note: Shopify's page editor may strip certain HTML if your schema disappears after saving; use the theme file method instead. Paste the schema into a page. about.liquid template under Templates in the code editor for a more reliable approach.

Bonus: Schema for Collection Pages

Shopify collection pages often have strong organic ranking potential but get almost no schema by default. Adding breadcrumb schema and CollectionPage schema to your collection template helps Google understand your site's category structure and can trigger breadcrumb rich results.

1
Open your collection template

In the code editor, open collection.liquid (older themes) or main-collection-product-grid.liquid under Sections (Dawn and newer themes). Add the following at the top of the file:

collection.liquid or main-collection-product-grid.liquid
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CollectionPage",
  "name": "{{ collection.title | escape }}",
  "description": "{{ collection.description | strip_html | truncate: 200 | escape }}",
  "url": "{{ shop.url }}{{ collection.url }}"
}
</script>
<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 | escape }}",
      "item": "{{ shop.url }}{{ collection.url }}"
    }
  ]
}
</script>

Validate Your Schema

After adding any schema to Shopify, always validate it before considering the job done.

1
Use Google's Rich Results Test

Go to search.google.com/test/rich-results. Enter your page URL (e.g. a product page URL) and click Test URL. Google will crawl the live page and show whether your schema is valid and eligible for rich results.

For pages not yet published, use the Test code tab and paste your full rendered HTML or just the JSON-LD block to test it directly without needing a live URL.

2
Check Search Console for schema errors

In Google Search Console, go to Enhancements in the left sidebar. You'll see entries for each schema type Google has found on your site, products, breadcrumbs, etc. along with any errors or warnings. This is the most authoritative view of how Google sees your schema across your entire store.

After adding new schema, submit your sitemap via Sitemaps and request indexing for key pages via URL Inspection → Request Indexing to speed up the process.

Common Mistakes to Avoid

  • Duplicate Product schema. Many Shopify themes already output basic Product schema. Adding a second block creates duplicates that can confuse Google. Always check for existing schema before adding your own.
  • Liquid syntax errors breaking the page. A missing '%' or mismatched quote will cause your theme file to error. Shopify's editor will usually warn you to read the error message carefully before saving.
  • Price format mismatch. Shopify's money_without_currency filter can output prices with commas (e.g. "1,299.00"). Always chain | remove: ',' to avoid invalid JSON.
  • Special characters breaking JSON. Product titles or descriptions with apostrophes or quotes can break your JSON. Always use the | escape or | json filter on any user-generated string.
  • Fabricated ratings. Only include aggregateRating if your store has real, visible reviews. Adding fake rating data violates Google's guidelines and can result in a manual penalty.
  • Editing live theme directly. Always duplicate your theme and test on the duplicate first. One bad save to your live theme can break your entire storefront.

Frequently Asked Questions

Yes, but only a limited amount. Most Shopify themes output basic product schema on product pages typically just the name and URL. Custom schemas like Organization, wSebsite, FAQ, or rich Product schema with ratings and pricing need to be added manually as described in this guide. Some premium themes (like Dawn) have better built-in schema, so always check before adding your own.
Yes, with minor path differences. Older themes use .liquid template files directly. Newer Online Store 2.0 themes (like Dawn) use JSON templates that reference Liquid section files. The Liquid code itself is the same; you just need to find the right section file. For Dawn, product schema goes in sections/main-product. The liquid and collection schema goes in sections/main-collection-product-grid. liquid.
No. The methods in this guide are all manual, code-based, and completely free. Apps like SEO Manager or Smart SEO can automate schema for large stores, but they're not necessary, especially for stores where you want full control over exactly what schema is output.
Open article.liquid (or main-article.liquid in sections for Dawn) and add an Article schema block at the top. Use Liquid variables like {{ article.title }}, {{ article.published_at | date: '%Y-%m-%d' }}, and {{ article.author }} to dynamically populate the schema from each post's data.
Google needs to crawl and re-index your pages after the schema is added. This typically takes a few days to a few weeks depending on your crawl frequency. Speed things up by submitting your sitemap in Google Search Console and using URL Inspection → Request Indexing on your key product and homepage URLs immediately after publishing.

Related Tools