ShopifyApril 3, 2025

Adding Schema Markup to Shopify: JSON-LD for Rich Results

Schema markup gets your Shopify products rich snippets in Google — stars, prices, and availability right in search results. Here's how to add it properly.

Mark Cijo

Mark Cijo

Founder, GOSH Digital

Adding Schema Markup to Shopify: JSON-LD for Rich Results

You've seen those Google search results with star ratings, prices, and "In Stock" labels right in the listing. Those aren't decoration. They're called rich results, and they come from structured data — specifically, JSON-LD schema markup on your product pages.

Rich results get more clicks. Studies consistently show 20-30% higher click-through rates compared to plain text listings. When a customer searches "organic face serum" and your listing shows 4.8 stars, $45, and "In Stock" while your competitor shows a plain blue link and a meta description, who gets the click?

Shopify includes some basic schema by default, but it's often incomplete, outdated, or missing key properties that Google needs to display rich results. Here's how to audit what you have, fix what's broken, and add what's missing.

What Schema Markup Actually Does

Schema markup is code you add to your pages that tells Google what the content IS, not just what it says. It's a translation layer between your page and Google's understanding.

Without schema, Google reads your product page and tries to figure out on its own: "Is this a product? What's the price? Is it in stock? Does it have reviews?" Sometimes it gets it right. Often it doesn't.

With proper schema, you're telling Google explicitly: "This is a Product. The name is X. The price is Y. The availability is Z. The rating is 4.8 from 127 reviews." Google doesn't have to guess. And when Google doesn't have to guess, it rewards you with rich results.

JSON-LD (JavaScript Object Notation for Linked Data) is Google's preferred format for schema. It's a script block that sits in your page's head or body without affecting the visible content. Clean, separate, easy to maintain.

What Shopify Includes by Default

Most Shopify themes include basic Product schema. But "basic" means it often has:

  • Product name
  • Product description
  • Price
  • Availability (in stock or out of stock)
  • Brand name
  • One product image

What's usually missing:

  • Aggregate rating (star reviews)
  • Individual review data
  • Multiple images
  • Product variants (color, size) with individual pricing
  • SKU and MPN/GTIN identifiers
  • Shipping details
  • Return policy
  • Offer validity dates

The missing pieces are exactly what Google uses to display rich snippets. Without them, your basic schema might validate but won't trigger rich results because Google doesn't have enough information to justify displaying them.

Auditing Your Current Schema

Before adding anything, check what you already have.

Step 1: Go to Google's Rich Results Test (search.google.com/test/rich-results). Enter one of your product page URLs.

Step 2: Look at the detected schema types. You should see "Product" as a detected type. Click into it and check what properties are present.

Step 3: Note the warnings and errors. Google distinguishes between errors (the schema is broken) and warnings (the schema is valid but missing recommended properties). Fix errors first. Then address warnings.

Step 4: Test 3-5 different product pages. Schema can behave differently depending on whether the product has variants, reviews, or images.

Adding Complete Product Schema

Here's what a complete Product schema should include for Shopify. The implementation method depends on your theme, but the data structure is universal.

The essential properties:

name — Your product title.

description — Your product description (first 200-300 characters).

image — Array of product image URLs. Include all product images, not just the first one.

brand — Your brand name wrapped in a Brand type.

sku — The SKU for the product or selected variant.

gtin or mpn — Barcode or manufacturer part number if available. This helps Google match your product to its product catalog.

offers — This is where price, availability, and currency live. Each variant should have its own offer if prices differ.

Within the offers object:

price — The numeric price.

priceCurrency — USD, GBP, EUR, etc.

availability — Use schema.org values: InStock, OutOfStock, PreOrder.

url — The canonical URL of the product page.

seller — Your store organization.

priceValidUntil — If the price is temporary (sale pricing), include the end date.

shippingDetails — Shipping rate and delivery time.

hasMerchantReturnPolicy — Link to your return policy.

For reviews:

aggregateRating — The overall star rating and number of reviews.

review — Individual review entries with author, rating, and review body.

Implementation in Shopify

There are three ways to add schema to Shopify. Each has trade-offs.

Method 1: Theme Code (Liquid)

This is the most reliable method. You add the JSON-LD directly to your product template using Liquid variables that pull from Shopify's product data.

Edit your product.liquid or main-product.liquid section (varies by theme). Add a script block with type "application/ld+json" that builds the schema from Shopify's product object.

The Liquid template pulls:

  • product.title for the name
  • product.description for the description (strip HTML tags)
  • product.featured_image and product.images for images
  • product.vendor for brand
  • product.selected_or_first_available_variant.sku for SKU
  • product.selected_or_first_available_variant.price for price (divide by 100 for dollars)
  • product.selected_or_first_available_variant.available for availability

Pros: Free, fast-loading, reliable, updates automatically when product data changes.

Cons: Requires code editing, might get overwritten during theme updates, needs development knowledge.

Method 2: Shopify App

Apps like JSON-LD for SEO, Schema Plus, or Smart SEO add schema automatically based on your product data. Install, configure, done.

Pros: No code editing, handles updates automatically, often includes schema for all page types (not just products).

Cons: Monthly cost ($5-20/month), adds app script overhead, you're trusting a third party with a critical SEO element.

Our recommendation for apps: If you choose the app route, pick one that lets you preview and validate the generated schema. Some apps produce schema that validates but doesn't trigger rich results because they miss key properties.

Method 3: Google Tag Manager

Add the JSON-LD via a custom HTML tag in GTM that fires on product pages. The tag uses the data layer to populate product information.

Pros: No theme code changes, easy to update, centralized tag management.

Cons: Google has stated that JavaScript-rendered schema may not always be crawled. While it generally works, the safest approach is server-rendered schema (Method 1 or 2).

Beyond Product Pages

Product schema is the most impactful for eCommerce, but don't stop there.

Organization schema (homepage) — Tells Google about your business: name, logo, social profiles, contact info. This powers your knowledge panel.

LocalBusiness schema (if applicable) — If you have a physical location, this gets you into local search results with address, hours, and phone number.

BreadcrumbList schema (all pages) — Shows the page hierarchy in search results. "Home / Women's / Dresses / Summer Midi Dress" appears below your listing.

Article schema (blog posts) — Enables article rich results with publish date, author, and featured image.

FAQ schema (FAQ pages or product pages with FAQs) — Displays expandable questions and answers directly in search results. This takes up massive real estate in the SERP.

HowTo schema (tutorial content) — Displays step-by-step instructions in search results.

Common Schema Mistakes on Shopify

Mistake 1: Duplicate schema. Your theme adds Product schema AND you install an app that adds it again. Google sees two conflicting schemas and might ignore both. Always check for existing schema before adding new.

Mistake 2: Using wrong availability values. "In Stock" is not a valid schema value. It must be the full URL: "https://schema.org/InStock" — capital I, capital S, no space.

Mistake 3: Prices without currency. Schema requires both a numeric price AND a currency code. "45.00" without "USD" is incomplete.

Mistake 4: Review schema without real reviews. Don't add a fake 5-star aggregateRating. Google can verify this against third-party review sources. If they catch manufactured review schema, they'll remove all your rich results and potentially penalize you.

Mistake 5: Variant handling. If your product has variants at different prices, listing only one price in the schema can trigger a warning. Use the "AggregateOffer" type with a lowPrice and highPrice when variants have different pricing.

Mistake 6: Not updating schema when products change. If you manually added schema and the product price changes, the schema still shows the old price. This is why dynamic schema (Liquid or apps) is better than hardcoded JSON-LD.

Validating Your Implementation

After adding schema, validate it before waiting for Google to notice.

Google Rich Results Test — Tests specific URLs for rich result eligibility. Shows you exactly what Google sees.

Schema.org Validator — Validates the technical structure of your schema against the schema.org specification.

Google Search Console — After implementation, monitor the "Enhancements" section. Google will report issues with your structured data here as they crawl your pages.

Manual SERP check — After 2-4 weeks, search for your products on Google. Look for rich results (stars, price, availability). If they appear, your schema is working. If not, re-validate and check for issues.

The Timeline for Results

Schema markup doesn't produce instant results. Here's what to expect:

Week 1-2: Google crawls and processes your updated pages. Check Search Console for any structured data errors.

Week 3-4: Rich results start appearing for some pages. Usually your highest-authority pages show up first.

Month 2-3: Broader rich result coverage across your product catalog. Click-through rates start improving measurably.

Ongoing: Monitor Search Console for new issues. As you add products, ensure they inherit the schema structure. Keep review counts current.

What To Do Right Now

Run three of your product pages through Google's Rich Results Test. Look at what's detected and what's missing.

If you see warnings about missing "aggregateRating" or "review" data — that's your biggest opportunity. Adding review schema is the single highest-impact change for most Shopify stores.

If you see errors, fix those first. Errors mean your schema is broken and Google might be ignoring it entirely.

If you want a full technical SEO audit of your Shopify store — including schema, site speed, crawlability, and indexation — book a call with our team. We'll identify every technical SEO opportunity and prioritize them by revenue impact.

Mark Cijo

Written by Mark Cijo

Founder of GOSH Digital. Klaviyo Gold Partner. Helping eCommerce brands grow revenue through data-driven marketing.

Book a free strategy call →

Want results like these for your brand?

Book a free call. We'll look at your data and show you what's possible.

Pick a Time

15 minutes. No pitch deck. Just your data and our honest take.