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.
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 |
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.
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.
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.
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.
{% 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.
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.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) openmain-product.liquidunder Sections instead
Scroll to the very top of the file and paste your schema block at the beginning, before any other output.
This schema uses Liquid variables to dynamically populate every field with your actual product data; no manual editing is required per product.
<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.
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:
// 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.
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.
Use the appropriate Schemify generator for your page type:
- About page: Organization Schema Generator
- FAQ page: FAQ Schema Generator
- Contact page: WebPage Schema Generator
Fill in the form and copy the generated JSON-LD output including the <script type="application/ld+json"> tags.
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.
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.
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:
<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.
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.
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_currencyfilter 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
| escapeor| jsonfilter 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
sections/main-product. The liquid and collection schema goes in sections/main-collection-product-grid. liquid.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.