Structured Data for Shopify: The Definitive Guide

Structured Data for Shopify: The Definitive Guide

This post was originally published in June, 2019. Last updated: November, 2021.

This is a rich result (aka a rich snippet). Rich results display more data than regular search results. For example, while regular results display only a page’s title, URL, and meta description, rich results can also display product ratings, number of reviews, price ranges, and more.

Since you’re here, you probably want Google to display similar results for your Shopify store. For this to happen, you have to add structured data markup to your website, which can be a hassle.

You need to be tech-savvy. You must be familiar with Shopify Liquid, HTML, JSON-LD (JSON for Linking Data), and schema.org (data types and properties). But even if you are a skilled developer, you might find it difficult to define exactly what data types and properties you need to add to your Shopify store.

As Shopify experts, we help Shopify merchants add structured data to their stores through our Smart SEO app and through our customization services every day. In this article, we will summarize our experience and share the knowledge we’ve gained along the way. We will talk about what structured data is and how you can implement it. We will also tackle the specific schema.org data types and properties you should add to your Shopify homepage, product, collection, blog and article pages.

After you read this guide, you will realize that implementing structured data, intimidating at first glance, can be quite straightforward as long as you have the right information.

What you'll learn

What is structured data & how can it benefit you?

This is structured data markup:


A screenshot of shop.vanillapup’s HTML, February 6, 2020. To see the HTML of a page, right click (anywhere on the page) and select the ‘View Page Source’ option from the drop-down menu.

And this is the result of implementing structured data markup:


Structured data markup gives search engines more information about your website and its content. In the context of e-commerce, structured data can provide Google with valuable information about your products (e.g. pricing, availability, rating, number of reviews, etc.). It can also give Google detailed information about your business (e.g. logo, address, contact information, connected social media pages, founders, subsidiaries, etc.).

Why is it important that Google has this information?

Structured data allows search engines and web systems to read and better understand what your website is about. In this way, Google can present your products (and other web pages) in a more detailed and reliable manner. One important aspect of this is that Google uses structured data to create rich snippets. Google can also use the markup for your product pages to create automated product feeds for your Google Shopping Ads.


Google does not guarantee that you will get rich snippets even if your pages are marked up correctly. This is explicitly stated in Google’s Structured Data Guidelines:


But if you add structured data markup to your website, Google is more likely to give you rich snippets and in most cases it does.

Structured data formats & schemas

Structured data formats

As described in the Google Webmaster Blog, structured data formats “define a small number of fixed structures that can be used to encode descriptive data.”

There are 3 structured data formats:

  • JSON-LD
  • RDFa
  • Microdata

Google recommends using JSON-LD for structured data.


Source: Google, Understand how structured data works

The takeaway: If you’re using Microdata or RDFa, it is best to consider migrating to JSON-LD. JSON-LD is easier to add and update and it is compatible with dynamic data. In addition, if you use JSON-LD, you don’t have to change your HTML code to indicate where the structured data is. Learn more → PracticalEcommerce, To Grow Search Traffic, Add JSON-LD

Structured data schemas

Structured data schemas define terms for different types (e.g. “WebSite”, “Person”, “Organization”) and properties (e.g. “name”, “description”, “logo”). Structured data schemas include:

Data-vocabulary.org is outdated.

As of January 29, 2021, data-vocabulary.org markup will no longer be eligible for Google rich result features. To be eligible after January 29, 2021, you need to replace data-vocabulary.org markup with schema.org markup. Learn more about sunsetting support for data-vocabulary. (Source: Google Search Central, Understand how structured data works)

Important

If you’re using data-vocabulary.org, you must replace your data-vocabulary.org markup with schema.org markup.

Now that you know what structured data is, why you should use it, and what is Google’s preferred structured data format (JSON-LD) and schema (schema.org), let’s have a closer look at what you need to do before you implement structured data.

Before you implement structured data

You must do 3 things:

  • Define your main page types. For Shopify, the main page types are homepage, collection, product, blog, and article pages.
  • Define what schema.org types and properties you must add to each page of your Shopify website: homepage, product pages, collection pages, blog page, and article pages. For example, this is how the structured data markup for a product page should look:


Source: schema.org, Product, Example 2, JSON-LD

As you can see from the screenshot, structured data consists of types. Each type is associated with a set of properties. Common properties of the Product type include productID, description, name, height, weight, mpn, etc.

Each type can contain other types (arranged in hierarchical order). For example, the Product type contains a set of Offer types. The Offer types are actually your product variants and contain properties like price, availability, etc.

The core vocabulary of schema.org currently consists of 792 Types, 1447 Properties 15 Datatypes, 83 Enumerations and 445 Enumeration members.

We’re only interested in a handful of them. But before we get to the actual types and properties you need to add to your store’s individual pages, let’s see how you can implement structured data in your website’s HTML.

How to add structured data to your Shopify store?

There are 3 ways to implement structured data in your website’s HTML:

  • Use a Shopify SEO app like Smart SEO - Smart SEO automatically provides Google (and other search engines) with detailed structured data in JSON-LD format. For example, it generates structured data for every product on your collection pages. As a result, the app helps you get rich snippets and rank higher on the SERPs. Smart SEO sports a 4.9/5 rating. It has a free plan and three paid plans. Pricing starts from $9.99/month. Learn more → Smart SEO Pricing

Note that there are a handful of apps on the Shopify App Store that can add structured data to your store. We recommend that you use only one at a time. Otherwise, you may end up with a mess of duplicate structured data which can hurt your rankings.

  • Do it manually. For this to happen, you must be familiar with Shopify Liquid, JSON-LD (and JSON for that matter), HTML, and schema.org. If you’re not a skilled developer (or don’t have one in-house), we don’t recommend this option because of the possibility of introducing errors to your website’s HTML. Instead...
  • Work with a certified Shopify expert and outsource the task. We offer an SEO service which includes an SEO audit, structured data optimization, meta tags optimization, link optimization, and more. If you're interested in working with us, or want to learn more, do not hesitate to contact us.

Now that you know your options for implementing structured data in your Shopify store’s HTML, let’s take a closer look at the different schema.org data types and properties you need to add to the different pages of your website.

What structured data markup to add to your Shopify homepage?

You should add 2 data types to your homepage:

WebSite

Schema.org defines ‘WebSite’ as a set of related web pages that usually share the same domain. You have to include the following properties in the WebSite data type:

  • url - your website’s URL
  • target - “Indicates a target EntryPoint for an Action” (source: schema.org)
  • query-input - this is a text search deep link with -input that inlines “the resulting value of -input properties into action URLs” (source: schema.org)

Example: BeachCandy Swimwear, structured data generated with Smart SEO

Here’s BeachCandy Swimwear’s review of our app:

Read more Smart SEO reviews

Organization

For example, Store, SportsOrganization, Corporation, LocalBusiness, BikeShop, BookStore, WorkersUnion, HardwareStore, etc. Note that the more specific the Organization type is, the better. You have to include the following properties in the Organization data type:

  • name - your Shopify store or website's name
  • url - your website's URL
  • description - a description of your business (who you are, what you sell, how your product/service benefits customers, etc.)
  • logo - Google displays your logo in search results and in the Knowledge Graph (read full definition)
  • image
  • sameAs - links to your social media profiles (Facebook business page, Twitter profile, YouTube account, Instagram account, etc.)
  • address (PostalAddress) - streetAddress (street and number), addressLocally (city), postalCode, address Country (country)

You can also include a price range (priceRange), contact information (e.g. a phone number), geolocation, and more.

Example: Alexander Palm Photography, structured data generated with Smart SEO

Here's Alexander's review of our app:

Read more Smart SEO reviews

    What structured data markup to add to your Shopify product pages?

    You should add 3 data types to your product pages:

    The Product type describes the product itself and the Offer type describes a product variant with its price, sku, barcode, etc. You need to have one Product type and at least one Offer type for each product variant. If you do not have variants for a product, you will have the price, sku, barcode, etc. as properties of that product. These properties are added as a default variant in Shopify and you can use this variant to create your Offer type.

    Product

    Product data type (required properties):

    • name - product name
    • image - imageObject or URL of the product photo
    • offers - product variants

    Product data type (recommended properties):

    • productID
    • aggregateRating - the average review score of the product
    • brand
    • description
    • review
    • sku - a unique Stock Keeping Unit of the product
    • gtin8 / gtin13 / gtin 14 / mpn / isbn - global identifiers, or unique product identifiers

    It is important that you have the following recommended attributes: productID, brand, mpn (Manufacturer Part Number, MPN), and gtin (Global Trade Item Number, GTIN). This will help Google match search queries with your products.

    In Shopify, the GTIN is referred to as barcode and you can add it to your product variants. The GTIN is also your productID and can also serve as an MPN. Note that Smart SEO outputs the barcode for the productID, gtin and the mpn properties.

    Offer

    Offer data type (required properties):

    • availability (e.g. InStock, OutOfStock)
    • price
    • priceCurrency

    Offer data type (recommended properties):

    • itemOffered
    • priceValidUntil (in ISO 8601 date format)
    • url (the URL of the product page)
    • itemCondition
    • sku

    Example: The Dove Factor, structured data generated with Smart SEO

    Here's The Dove Factor's review of our app:

    Read more Smart SEO reviews

    BreadcrumbList

    It is a good practice to add breadcrumb markup to your product pages. This will help Google better understand and categorize the information from your product pages. The breadcrumb markup should contain the BreadcrumbList type. The BreadcrumbList type should contain at least one ListItem type. The ListItem type should contain the following properties:

    • position
    • item
    • id
    • name

    Here’s an example of breadcrumb markup generated with Smart SEO (Spyder Industries).

    And here’s Spyder Industries’ review of our app:

    Read more Smart SEO reviews

    Learn more about breadcrumb markup → schema.org - BreadcrumbList, Google Developers - Breadcrumb

    What structured data markup to add to your Shopify collection pages?

    The collection page should contain the CollectionPage type and also include one ListItem type for each product on the collection page.

    CollectionPage

    The CollectionPage type should contain the following properties:

    • name - the name of the collection page
    • url - the URL of the collection page
    • description - description of the collection page
    • image - the main image of the collection page

    Example: shop.vanillapup, structured data generated with Smart SEO


    Here’s Shop Vanillapup’s review of our app:


    Read more Smart SEO reviews

    ListItem

    The ListItem type should contain the following properties:

    • position - the position of the product on the collection page, i.e. if the product is displayed third, the position value would be “3”
    • url - the URL of the product page

    Example: Victorian Ladies, structured data markup generated with Smart SEO


    And here's Victorian Ladies' review of our app:


    Read more Smart SEO reviews


    It is also a good practice to add breadcrumb markup to your collection pages (please, check the Product page markup section for more information on breadcrumb markup).

    What structured data markup to add to your Shopify blog page?

    You should add only one data type to your blog page - Blog, - and include the following properties in your blog markup:

    • about - a description of your blog; the subject of the blog (e.g. e-commerce, Shopify, your product or service, etc.), how can it help readers, etc.
    • name - the name of your blog
    • url - the URL of your blog
    • keywords - the keywords you target

    The Blog type should contain a number of BlogPosting types. Each BlogPosting type is associated with an article or a publication. The BlogPosting type should contain the following properties:

    • headline
    • mainEntityOfPage - the canonical URL of the page
    • image (ImageObject)
    • url - the URL of the page
    • datePublished
    • dateModified
    • dateCreated
    • description - a description or an excerpt of the blog post
    • author
    • publisher
    • logo (publisher logo)
    • url (publisher URL)
    • name (publisher name)

    Example: Tiny Tots Baby Store, structured data generated with Smart SEO


    And here's Tiny Tots Baby Store's review of our app:


    Read more Smart SEO reviews

    What structured data markup to add to your Shopify article pages?

    Article pages in Shopify should have the Article type. The Article type should contain the following properties:

    • about - the subject of the article
    • headline - the headline of the article
    • mainEntityOfPage
    • image - the cover image of the article
    • url - URL of the article
    • dateModified
    • datePublished
    • dateCreated
    • description - a description or an excerpt of the article
    • articleBody - the body of the article
    • author
    • publisher
    • logo (publisher logo)
    • name (publisher name)

    Example: Tiny Tots Baby Store, structured data generated with Smart SEO

    Testing your structured data markup

    You can test your structured data with the Rich Results Test and the Schema Markup Validator.

    Google recommends starting with the Rich Results Test. In this way, you'll see what Google rich results can be generated for your pages. Next, you can use the Schema Markup Validator to test and validate all types of schema.org markup. Learn more → Test your structured data

    Wrap-up

    Adding structured data markup to your Shopify store will help search engines understand better what your website is about. It will also increase your chances of getting rich results which, in turn, will increase user engagement and your CTR - all leading to more sales.

    There are 3 structured data formats: JSON-LD, RDFa, and Microdata. Google prefers and recommends using JSON-LD for structured data.

    There are 2 structured data schemas (or vocabularies): data-vocabulary.org and schema.org. Data-vocabulary.org is outdated and is not eligible for rich results features. Thus, if you’re using data-vocabulary.org markup, you must replace it with schema.org markup.

    Structured data markup (or schema.org markup) consists of data types and properties arranged in hierarchical order. In Shopify, it is recommended that you add structured data to your homepage, product pages, collection pages, blog page, and article pages. Here is a brief overview of the data types and properties you should add to each of these pages:

    There are 3 ways to add structured data to your Shopify store:

    • Use a Shopify SEO app like Smart SEO
    • Do it manually
    • Outsource the task to a Shopify Expert - If you’d like us to take a look at your website’s SEO and implement structured data for you, don’t hesitate to contact us!

    You can test your structured data with the Rich Results Test and the Schema Markup Validator. Making sure that your pages are marked up correctly is the last step of implementing structured data.

    Your turn!

    We realize that this is a lot of information to take in at once and you must have a lot of questions. We’re here to answer all of them! But we'd also like to hear from you!

    How will you add structured data markup to your website? Will you use an app, will you do it in-house, or outsource it to a Shopify Expert?

    Or, maybe, you’ve already added structured data and want to share your experience?

    Whatever it is, just leave a comment below!

          Share

          Leave a comment

          • Sherpas Design

            Hi, Dave!
            Thanks for your input – we’ll definitely consider adding it!
            Best,
            Sherpas Design

          • Dave

            Hey, some good stuff on here but I was hoping you’d go into more detail on how to add the code manually. I’m a developer and scanned the Shopify docs and can’t find any documentation on how to do it manually. I thought this article would answer that question. Maybe you can add it?

          • Sherpas Design

            Hello, Damy!
            Thank you for considering using our app! If you’re using a theme that already outputs structured data, it is best to remove it before installing Smart SEO (or any other SEO app that outputs structured data). If you need any help, you can contact our support team – they’d be happy to help you remove the existing script.
            Hope this helps,
            Sherpas Design

          • Damy

            Hi Sherpas, great and helpful article!
            I’m interested in using your app for my Shopify store with a Dev Retina theme, which already outputs structured data in microdata and RDFa format.
            My question do I have to remove the script from the code before using smart SEO?

          • Sherpas Design

            Hello, Laura Munsch!
            There are many factors that affect organic rankings (including structured data and SEO apps like Smart SEO). Most likely, removing structured data (which helps Google understand your website better) or uninstalling an SEO app (that helps you optimize your store for search engines) will negatively impact your rankings.
            Hope this helps,
            The Sherpas Design team

          • Laura Munsch

            If a previous administrator removed a tool like Smart SEO or removed the structured data, would that cause a drop in the organic searches?

          • Anna

            Great article. Helped me so much. Thanks

          • Aaron Bower

            How do you run a scan of your Shopify site on Rich Text if you have an Age Gate?

          • Frisco Web Solutions

            That’s really nice post. I appreciate your skills. Thanks for sharing.

          • Radostina @ Sherpas Design

            Thanks, Brandon!
            I’ll check out your article to learn more!
            Best,
            Radostina @ Sherpas Design

          • Brandon Lazovic

            Nice article! When auditing websites, I often find improper use of structured markup that’s riddled with warnings and errors. I love using Google’s Structured Data Testing Tool to check and correct these issues, but unfortunately, Google is deprecating their tool in favor of the rich results tester, which isn’t as convenient because it only provides markup suggestions if the schema is eligible for rich results.

            I talk about this in my latest post, but outside of Google’s Structured Data Testing Tool, Merkle’s Schema Tester is my second favorite for making sure my schema markup is set up properly: https://brandonlazovic.com/best-structured-data-testing-tools-for-schema-markup

          • Radostina @ Sherpas Design

            Hello, Echo!

            Sorry to hear you didn’t find the article helpful!

            First, I’d like to address your question regarding scripts and themes:

            There are some themes that output structured data. However, because many of the themes (especially the free ones) are not updated regularly, the structured data they output contains a lot of warnings. In addition, some older themes are still using the deprecated format of microdata – W3C and Google recommend the JSON-LD format.

            The scripts in the liquid code that output JSON-LD structured data are of the type ld+json. Please note that some apps, such as review apps, might be outputting structured data via the very same type of scripts.

            The Microdata is output via the Itemscope and Itemprop attributes.

            Second, the purpose of this guide is to provide information on the data types and properties you need to add to your store.

            In section 4 of the guide (How to add structured data to your Shopify store), we also explained 3 different ways in which structured data can be implemented in your website:

            1. You can use a Shopify app such as JSON-LD For SEO or Smart SEO.

            2. You can do it manually if you’re familiar with Shopify Liquid, json-ld, html, and schema.org.

            3. You can outsource it to a certified Shopify expert.

            Hope this answer helps!

            Kind regards,
            Radostina @ Sherpas Design

          • Echo

            I thought this was everything we need to know and it fell short. Where the heck is the Structured Data in Shopify? Does Shopify have it’s own script running somewhere else if you’re theme doesn’t come with it.

            This left out a ton of information.

          • Radostina @ Sherpas Design

            Hello, Olya!
            Thank you, I’m glad to hear that you found the article helpful! Could you, please, provide more specific information about the errors? Or, you can also contact our support for assistance with this. If you wish, we can request a collaborator account and fix the errors for you.
            Hope this helps,
            Radostina @ Sherpas Design

          • Olya

            Hello, This is a great article with quite clear explanations. But something I still can’t figure out. we’ve got some errors at different product pages, found out what needs to be fixed (Structured Data Testing Tool) but still can’t figure out where to fix it. I mean where to find that code. Also when purchasing Smart SEO, you mentioned that it will provide structured data for each page of the website, does it mean there will be a way within this app fix any errors that will occur? Thank you in advance!

          • Samy

            Hello guys, i need to add a getdate() fonctionne when i modify my blog article.
            how can i do that dynamically? thanks in advance

          • Radostina @ Sherpas Design

            Hello, Mark!

            Yes, you can. I found a discussion in the Shopify Community you might find helpful: https://community.shopify.com/c/Shopify-Discussion/how-to-add-schema-org-to-my-website/td-p/402071#

            Best,
            Radostina @ Sherpas Design

          • Mark

            Can you add FAQ schema to blog posts?

          • Radostina @ Sherpas Design

            Hello, Megan!
            The easiest way to apply templates for JSON-LD structured data is to use our Smart SEO app (https://apps.shopify.com/smart-seo). It automatically generates detailed structured data (for example, the app generates structured data for every product on your collection pages). The app has a 7-day free trial. Please, let us know if you have further questions :)

            Best,
            Radostina @ Sherpas Design

          • Megan

            Hi!

            Do you have any Shopify templates for JSON that can be applied to all pages? All the examples above would need to be done individually. For example:

            { "@context": "http://schema.org/", "@type": "Product", "url": "{{ shop.url | append: '/products/' | append: product.handle }}", "name": "{{ product.title }}", "image": "{{ product.featured_image.src | img_url: 'master' }}", "description": "{{ product.description | strip_html | escape }}", {% if collection_urls != blank %} "category": [ {{ collection_urls }} ], {% endif %} "brand": { "name": "{{ product.vendor }}" }, "offers": { "@type": "Offer", "priceCurrency": "{{ shop.currency }}", "price": "{{ current_variant.price | money }}", "availability": "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}", "seller": { "@type": "Organization", "name": "{{ shop.name }}" } } }

            In this case above, the schema is automatically added for all pages based on what information is in the product page.

            Is there a way to combine this with other pieces of json data that does need to be entered manually?

            Thanks!

          • Radostina @ Sherpas Design

            Hello, hamza!
            Thank you for the kind words! Could you please share more information about what you want to achieve – for example, which pages of your website would you want to add the structured data markup to, and what kind of rich snippets are you hoping to get?
            Best,
            Radostina @ Sherpas Design

          • hamza

            Hello sherpas,
            Nice article please let me know where do I paste this code in shopify and this will be working or not ?

          • Radostina @ Sherpas Design

            Hello, Mahiza!
            Adding CollectionPage markup will give Google (and other search engines) more detailed information about your website. If there are no errors, this can only increase your chances of getting rich snippets. It cannot hurt your rankings in any way.
            Regarding your question about the Vanillapup example: The collection page should contain the CollectionPage type and also include one Product type with an Offer for each product present on the page. In other words, if there are 10 products on the collection page, there should be 10 Product Types with an Offer.
            Regarding the Parissa example, it appears that they have deleted their CollectionPage markup after the last time we updated the article (which was in June). We don’t know why they did this, but thank you for bringing our attention to it – we will remove the example from the article so that the content is up to date!
            Best Regards,
            Radostina from Sherpas Design

          • Mahiza Moore

            Hello! I really appreciate your article. I am inquiring about the CollectionPage markup specifically. Is it best practice to add this? I haven’t seen many others blog about the CollectionPage schema code- only really the product which got my curious. Have you seen results from this?

            For the vanillapup example, i was a bit confused because you said one product and offer should go in the collection page schema but when going to the site and viewing the page source it looks like there were almost 234 products!

            Also, the parissa example, when you view page source there isn’t any collectionpage schema which threw me off. Did they remove it because they didn’t see results from it?

            Looking forward to hearing back from you

            -Mahiza