Adding and linking custom structured data to JSON-LD for SEO

While JSON-LD for SEO tries to supply a complete set of data for all Shopify stores, sometimes you might need to supplement its data with something custom.

For new types of structured data, you can just add them anywhere in your Shopify theme and they’ll work. JSON-LD is flexible like that.

If you want to modify the data types JSON-LD for SEO provides, here’s how to do it.

1. Create a new block of JSON data

The first step is to create a new block of JSON data that you want to add. I like to write this in a text file so you can copy and paste it where it goes.

Let’s say you want to add information about your stores founding to the business information. We’ll code that up like this

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"founder": "Eric Davis",
"foundingDate": "2007-07-19"
}
</script>

Adding that to Google’s Structured Data Testing tool shows that it works but is missing the base data.

2. Link the data to JSON-LD for SEO

Now that you have the data you want to add, you need to link it to the main data. This uses the @id field and is what the LD part of JSON-LD means (Linked Data).

JSON-LD for SEO uses your store domain as the @id with a suffix of #org. You can easily find the current @id by using Google’s Structured Data Testing tool.

Adding the same @id to our data, we have this:

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "https://json-ld-for-seo-demo.myshopify.com/#org",
"founder": "Eric Davis",
"foundingDate": "2007-07-19"
}
</script>

3. Adding the new JSON-LD data to the Shopify theme

The last step is to add that new block of data to your theme.

You’ll want to put it into different places depending on what data you’re adding.

If you’re adding data for a specific product, blog post, or page? Add that using Shopify’s editor using the HTML mode.

Adding data for all products? Add the data to your product template.

Adding data for every page? Add the data to your theme’s layout template.

Where you put the data doesn’t matter. It can be above JSON-LD for SEO’s snippet, below, or anywhere else on the page. I recommend putting it near the end of the page so it doesn’t impact loading times.

One important note:

You do not want to modify JSON-LD for SEO’s snippet directly. Doing so will cause your changes to be lost on the next update. That’s why there’s a big ol’ warning at the top of the file.

List of IDs

To help you out, here’s a list of the IDs used by the major data types.

  • Organization/Store/Local Business – your store url with the suffix of #org.
  • Website – your store url with the suffix of #website.
  • Product – your product’s canonical url with the suffix of #product.
  • Blog posts – your blog post’s canonical url with the suffix of #article.
  • Shopify pages – your page’s canonical url with the suffix of #article.
  • Videos – your page’s canonical url with the suffix of #video.
  • Recipes – your page’s canonical url with the suffix of #recipe.
  • FAQs – your page’s canonical url with the suffix of #faq.

That’s it. That’s the entire process to add custom JSON-LD structured data to your Shopify store by piggybacking on JSON-LD for SEO.

Get more organic search traffic for your Shopify store

JSON-LD for SEO icon

Increase organic SEO traffic through Google's Rich Results. One click allows search engines and others to understand your store and products.

Install JSON-LD for SEO