Step-by-step Guide to Adding Product Schema to Your Shopify Store

Optimizing your Shopify store for search engines can significantly increase your visibility and sales. One effective way to do this is by adding product schema markup, which helps search engines understand your product details better. This step-by-step guide will walk you through the process of adding product schema to your Shopify store.

Understanding Product Schema

Product schema is a type of structured data that provides detailed information about your products to search engines. When correctly implemented, it can enhance your search listings with rich snippets, such as star ratings, price, availability, and more, making your listings more attractive to potential customers.

Step 1: Access Your Shopify Theme Files

Log in to your Shopify admin dashboard. Navigate to Online Store > Themes. Find your active theme and click on Actions > Edit code. This will open the theme code editor where you can add custom code.

Step 2: Locate the Product Template

In the code editor, find the product template file, typically named product.liquid or main-product.liquid. It is usually located in the Templates or Sections folder. Open this file to add your schema markup.

Step 3: Add JSON-LD Script for Product Schema

Within the product template, locate the tag that outputs your product details. Just before the closing

tag, add a script tag with type application/ld+json. Inside this script, insert the JSON-LD structured data for your product.

Here is a basic example of product schema in JSON-LD format:

{ “@context”: “https://schema.org/”, “@type”: “Product”, “name”: “{{ product.title }}”, “image”: “{{ product.featured_image | img_url: ‘large’ }}”, “description”: “{{ product.description | strip_html | truncate: 200 }}”, “sku”: “{{ product.sku }}”, “offers”: { “@type”: “Offer”, “price”: “{{ product.price | divided_by: 100 }}”, “priceCurrency”: “USD”, “availability”: “{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}” }, “aggregateRating”: { “@type”: “AggregateRating”, “ratingValue”: “{{ product.rating | default: ‘4.5’ }}”, “reviewCount”: “{{ product.review_count | default: ’10’ }}” } }

Replace the placeholders with your actual product data or use Shopify variables to automate this process.

Step 4: Save and Test Your Schema

After adding the JSON-LD script, save your changes. To verify that your schema is correctly implemented, use Google’s Rich Results Test tool. Enter your product page URL and check for any errors or warnings.

Additional Tips

  • Keep your schema data up to date with product changes.
  • Use accurate and detailed information for better search results.
  • Consider adding other schema types, such as reviews or offers, for enhanced visibility.

Adding product schema to your Shopify store can improve your search presence and attract more customers. Follow these steps carefully, and you’ll be on your way to richer search listings.