How to Generate Shopify Product Schema Markup in JSON-LD

PRODUCT SEO & STRUCTURED DATA9 min read

Build Product JSON-LD from the details shoppers can see, check whether your Shopify theme already outputs schema, and validate the published product page.

Table of Contents
  1. The short answer
  2. Check for existing Shopify schema first
  3. Build JSON-LD from the real product page
  4. Add the markup to Shopify carefully
  5. Validate the page, not only the JSON
  6. Common Shopify Product schema mistakes
  7. Frequently asked questions

The short answer

Product JSON-LD = Product facts that match the page + a valid Offer when the product is for sale + optional verified details such as brand, SKU, and genuine reviews.

JSON-LD is a structured data format that helps search engines interpret product information. It does not guarantee a rich result or improve rankings by itself. Start with one product page, make the markup match the visible offer, and validate the published URL.

The Shopify Product Schema Generator creates a Product JSON-LD script from a product name, image URL, price, currency, and availability, with optional brand, description, product URL, SKU, and aggregate rating. It produces copyable code and links to Google’s Rich Results Test; it does not add the code to your Shopify theme automatically.

Check for existing Shopify schema first

Before adding another script, inspect the rendered source or use Google’s Rich Results Test on a published product URL. Many Shopify themes or SEO apps already output Product structured data. Adding a second product entity with different price, availability, or variant details can create conflicting signals.

Shopify’s developer docs include a Liquid structured_data filter that can serialize a product object to schema.org JSON-LD: {{ product | structured_data }}. Check your theme and app output before using a generator or manually adding a second block. Shopify’s structured_data Liquid filter documentation explains which objects it supports, including Product and ProductGroup behavior for variants.

If markup is missing or incomplete, work in a duplicated theme or staging copy first. Shopify Online Store themes use Liquid templates and sections; an implementation usually belongs in the product template or an included product snippet so the output is present on the relevant product pages. Avoid pasting a static price or availability into a template that serves products with different variants.

Build JSON-LD from the real product page

For a product page where shoppers can buy one product, Google supports Product structured data with an Offer. The exact eligibility requirements differ between Product snippets and Merchant listings. Google’s Product structured data overview explains which experience applies; its Merchant listing documentation covers additional offer, shipping, and return-policy details for eligible seller pages.

Here is a compact example. The names, image, URL, price, and stock status are illustrative and must be replaced with values that are true on the live page:

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Canvas Market Tote",
  "image": ["https://example.com/images/canvas-tote.jpg"],
  "description": "A reusable cotton canvas tote with reinforced handles.",
  "sku": "TOTE-BLK-01",
  "brand": { "@type": "Brand", "name": "Northstar Goods" },
  "offers": {
    "@type": "Offer",
    "url": "https://example.com/products/canvas-market-tote",
    "priceCurrency": "USD",
    "price": "39.00",
    "availability": "https://schema.org/InStock"
  }
}

name and image should identify the same product shown in the page content. offers.price and priceCurrency should reflect the offer a shopper can buy, while availability should match the purchase state. Update the markup when price, stock, or selected variant changes. A product with several variants may need variant-aware URLs and offer data; a single static Offer may not represent every variant correctly.

Only add properties you can verify. Do not invent a SKU, brand, discount, price-valid-through date, review count, or rating just to fill a field. If you include aggregateRating, it must represent real reviews and remain consistent with content shoppers can see. Google can ignore or take action on misleading or irrelevant structured data.

Add the markup to Shopify carefully

  1. Open a duplicate or development theme so you can review changes before publishing.
  2. Inspect the product page’s rendered HTML and run the published URL through Google’s Rich Results Test to find existing Product entities.
  3. If the theme already emits accurate markup, improve its product or variant fields instead of adding a duplicate block.
  4. If you need a new block, connect its values to Shopify’s product and selected-variant data rather than hard-coding one example’s values.
  5. Escape dynamic values for JSON correctly. Do not concatenate untrusted product text into a script without JSON serialization.
  6. Preview several products, variants, sale states, and stock states. Confirm the script and visible page agree.
  7. Publish the theme change, validate the live URL again, and monitor Search Console’s relevant product reports after Google recrawls it.

The Product JSON-LD generator for Shopify pages is useful for assembling and previewing a clean example. The generated script is a snippet, not a theme integration: you still need to add it in the right Liquid context, ensure it is server-rendered for crawlers, and test variant behavior. The generator currently supports USD, EUR, or GBP and in-stock or out-of-stock availability values; use another implementation if your product requires unsupported currencies or richer offer modeling.

Validate the page, not only the JSON

Valid JSON syntax does not mean eligible Google markup. Test the actual product URL, inspect detected items and errors, and check that the page is accessible to crawlers. Google recommends placing Product structured data in the initial HTML for merchant listings where possible; JavaScript-generated markup can make product data less reliable to crawl for fast-changing values such as price and stock.

Structured data has to describe the page users see. If the page says $39 and in stock but the JSON says $34 and out of stock, correct the source. If a product variant has a different price, image, or SKU, make sure the selected variant and its URL are represented appropriately. Ensure canonical URLs resolve and images are crawlable.

Passing a test means Google can parse the markup and may consider the page for an eligible search appearance. It is not a promise that Google will display a rich result. Eligibility can depend on the query, device, policy compliance, indexing, and Google’s own systems. After launch, use Search Console to review Merchant listings and Product snippets reports where applicable; Google notes that indexing and report updates can take time.

Common Shopify Product schema mistakes

  • Adding a second Product script when the theme or an app already provides one.
  • Marking up a collection or search page as if it were one purchasable product page.
  • Leaving a static price or availability in place after a variant or inventory change.
  • Using a product image URL that is not accessible to Google.
  • Adding fake or hidden ratings, reviews, brands, or sale prices.
  • Treating JSON-LD as a guarantee of a rich result or ranking increase.
  • Testing an editor preview but never validating the published product URL.
  • Pasting a copied snippet into a theme file without binding it to real Shopify product data.

Frequently asked questions

Does Shopify automatically add Product JSON-LD?

It depends on the theme and installed apps. Inspect a rendered product page and test its URL before adding new markup. Shopify also provides a Liquid structured_data filter for product and article objects in theme code.

Where should Product JSON-LD go in a Shopify theme?

It should be rendered on the relevant product page, typically through its product template or a snippet included by that template. Use dynamic product and variant values, and check whether existing theme markup makes an additional script unnecessary.

Will Product schema guarantee product rich results?

No. Correct markup can make a page eligible for supported search appearances, but Google decides whether to show them. Eligibility, indexing, query context, and policy compliance all matter.

Can I include review stars in Product JSON-LD?

Only when the rating and review count are genuine, current, and supported by reviews shown to users. Never use placeholder or fabricated ratings.

Should I add Product JSON-LD to every Shopify page?

No. Product markup belongs on relevant individual product pages. A collection page is not a single product page; use structured data that accurately describes that page type instead.