Product breadcrumb schema

Topic summary

A Shopify store owner wants to manually implement JSON-LD breadcrumb schema for products after experiencing issues with the Smart SEO app, which requires URL modifications to display breadcrumbs.

Solution provided:

  • Add the schema to the <head> section of product pages via theme code editing
  • Access through: Online Store > Themes > Edit code, then modify /sections/main-product.liquid or /templates/product.liquid
  • Use Liquid templating with conditional logic ({% if template contains 'product' %})

Key clarifications:

  • Only one dynamic schema is needed—Shopify’s Liquid automatically populates product-specific data for each page
  • Google identifies which product the schema applies to based on the page URL and context
  • No need to paste separate schemas for individual products

Specific use case:
The user wants all products to show the same collection (“Matcha Collection”) in breadcrumbs. A hardcoded solution was provided showing: Home > Matcha Collection > Product Name.

The discussion includes code snippets demonstrating the implementation. Future automation using metafields was mentioned as a possibility. A Google developer guide link was shared as additional reference material.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

I want to paste in my JSON-LD product breadcrumb schema to show Google what collection the product primeraly belongs to. I have been using the Smart SEO app but there are some issues in that they wont show the breadcrumbs unless i amend the product URL so I want to do it myself and stop using thre app.

Where does the product JSON-LD breadcrumb schema get pasted and how does google know what product it is for?

Thank you so much

Hey @DavidsDD ,

You’re on the right track wanting to take control of your SEO schema—especially if the app you’re using isn’t giving you the control or output you want. Let’s break it all down for you.

Where to Paste the JSON-LD Breadcrumb Schema in Shopify:

You should add it to the section of your product page, usually via:

  1. Edit your product template file:
  • In Online Store > Themes > Edit code, go to:
/sections/main-product.liquid   or   /templates/product.liquid

Look for the tag or insert it right before the using:

{% if template contains 'product' %}
  
{% endif %}

If you want help writing a dynamic snippet based on a metafield for "primary collection’? Please Reach out thanks!

Best,

Rajat

Shopify Expert

1 Like

Thank you so much.

So for each of the breadcrumbs for each of the products so I just keep pasting in new schema? Does Google know what schema is for what product using the URL?

Thank you so much

You only need to add one dynamic JSON-LD schema in your theme. Shopify uses Liquid to fill in the correct product and collection info for each page. Google knows which product it applies to based on the URL in the schema and the page it’s on. No need to paste separate schema for every product.

1 Like

Thank you so much, this is brilliant.

So I want the same collection to show for every product so should I put this in?

Last question lol

You’re very welcome—and no worries, ask as many as you like!

If you want the same collection to show for every product, yes, you can hardcode it like this:

{
  "@type": "ListItem",
  "position": 2,
  "name": "Matcha Collection",
  "item": "{{ shop.url }}/collections/matcha"
}

So your full JSON-LD breadcrumb would look like:


This will show Home > Matcha Collection > Product Name for every product page—perfect if all your products belong to the same collection.

You’re doing great, by the way. Let me know if you ever want to automate this using metafields or tags down the line.

1 Like

If you’ve found my replies helpful, I’d truly appreciate it if you could like them as helpful. It really helps support my profile—thank you.

This is absolutely amazing help, thank you.

Automating with metafields would be great

1 Like

If you need any help with Shopify development, feel free to reach out—I’d be happy to assist!
Best regards,
Rajat

Shopify Developer

Hi @DavidsDD

For the place of pasting JSON-LD breadcrumb schema, you can check this guideline from Google below for reference, which explains how it works very clearly, thank you~

https://developers.google.com/search/docs/appearance/structured-data/breadcrumb