Skip to main content
Guide 3 of 10 · 4 min read

How to Add JSON-LD Structured Data to Your Shopify Store

There's a hidden layer on your product pages that AI agents read before anything else: JSON-LD structured data. It's a machine-readable block of code that tells crawlers and AI agents exactly what your product is, how much it costs, whether it's in stock, and who makes it.

You can't see it on the page. But AI agents can. And if it's incomplete or missing, they get an incomplete picture of your products.

What is JSON-LD?

JSON-LD stands for JavaScript Object Notation for Linked Data. It's a standard way to embed structured data in web pages using schema.org vocabulary.

In practice, it's a <script> tag in your page's HTML that contains a JSON object describing the page content. Search engines and AI agents read this block to understand your page without having to guess from the visible text.

What fields matter for product pages

A complete product JSON-LD block should include:

  • name — the product title
  • description — the product description (plain text, not HTML)
  • image — one or more product image URLs
  • brand — the brand or vendor name
  • sku — the product SKU
  • offers — price, currency, and availability (InStock, OutOfStock, etc.)
  • url — the canonical URL of the product page

Here's what a minimal but complete product markup looks like. First, the Liquid template you'd add to your theme (usually sections/main-product.liquid):

Liquid template

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "{{ product.title | escape }}",
  "description": "{{ product.description | strip_html | truncate: 500 | escape }}",
  "image": "{{ product.featured_image | image_url: width: 1200 }}",
  "brand": {
    "@type": "Brand",
    "name": "{{ product.vendor | escape }}"
  },
  "sku": "{{ product.selected_or_first_available_variant.sku | escape }}",
  "offers": {
    "@type": "Offer",
    "price": "{{ product.selected_or_first_available_variant.price | money_without_currency }}",
    "priceCurrency": "{{ cart.currency.iso_code }}",
    "availability": "https://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
    "url": "{{ shop.url }}{{ product.url }}"
  }
}
</script>

Rendered output

When Shopify renders the template above for a real product, the output looks like this:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Organic Cotton Throw Blanket",
  "description": "100% GOTS certified organic cotton. 50 x 60 inches.",
  "image": "https://cdn.shopify.com/s/files/1/example/blanket.jpg",
  "brand": {
    "@type": "Brand",
    "name": "Your Store Name"
  },
  "sku": "BLANKET-ORG-50x60",
  "offers": {
    "@type": "Offer",
    "price": "49.00",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock",
    "url": "https://yourstore.com/products/organic-cotton-throw"
  }
}
</script>

Beyond products: other schema types

Product schema is the most important, but there are other types that help AI agents understand your store:

  • Organization — add this to your homepage. Includes your business name, logo, URL, and contact info. Tells AI agents who runs the store.
  • BreadcrumbList — shows the page hierarchy (Home > Category > Product). Helps AI agents understand how products relate to collections.
  • FAQPage — if you have FAQ content on product pages, mark it up. AI agents can use this to answer customer questions directly.
  • MerchantReturnPolicy — lets AI agents read your return policy in a structured format, which is useful for agentic storefronts.

How to check what your store has now

  1. Open any product page on your store
  2. Right-click and select View Page Source
  3. Search for application/ld+json
  4. You should find at least one JSON-LD block. Look at what fields are included.

Many Shopify themes include some structured data, but it's often incomplete. Common missing fields: brand, sku, description, and availability.

You can also use Google's Rich Results Test to check any page. Paste your product URL and it shows you exactly what structured data Google can find.

How to fix it

This is a developer task. The structured data lives in your Shopify theme's product template (usually sections/main-product.liquid or a similar file).

What to tell your developer:

  1. Audit the current JSON-LD on product pages — check which fields are present and which are missing
  2. Add missing fields: brand, sku, description, availability
  3. Add Organization schema to the homepage or layout
  4. Add BreadcrumbList schema to product and collection pages
  5. If you have FAQ content, add FAQPage schema
  6. If you have a return policy, add MerchantReturnPolicy schema

This is one of the highest-impact changes you can make. It's invisible to customers. A developer can implement it in a few hours. And it directly improves how AI agents read and recommend your products.

Open Graph tags

While you're checking structured data, also look at your Open Graph (OG) tags. These are <meta> tags in the page <head> that AI agents and social platforms use when your pages are shared or referenced.

The important ones:

  • og:title — the product name
  • og:description — a short product description
  • og:image — the primary product image
  • og:url — the canonical URL
  • og:type — should be "product" for product pages

Most Shopify themes handle these, but customizations and apps can break them. Check by viewing the page source and searching for og:.

Check your store

We're launching soon. Get notified when you can scan your store.