How to Add Product Schema to Shopify

How to Add Product Schema to Shopify

Adding product schema to your Shopify store can help your products stand out in search results by displaying rich snippets like star ratings, price, and availability. This boosts visibility, improves click-through rates, and ensures search engines understand your product details. Here's a quick overview of how to do it:

  • What is Product Schema? A structured format (JSON-LD) that organizes product details for search engines.
  • Why It Matters: Rich snippets make your listings more appealing and accurate in search results.
  • Steps to Add Schema:
    1. Backup Your Theme: Save a copy of your current theme before making changes.
    2. Create a Snippet: Add a new snippet in your theme editor for schema code.
    3. Add Schema Code: Use JSON-LD to include details like name, description, price, and availability.
    4. Embed in Product Pages: Link the snippet to your product templates.
    5. Test Your Schema: Use Google’s Rich Results Test to verify your setup.

Keeping your schema up-to-date ensures accurate product details are displayed, enhancing your store’s search performance. Follow these steps to make your Shopify store more visible and engaging for shoppers.

What is Product Schema?

Product schema organizes product details into a format that's easy for search engines to understand. Shopify stores use JSON-LD, which keeps structured data separate from HTML, making updates simpler. Here's a quick guide to implementing schema in your Shopify theme.

Required Schema Properties

Make sure to include these key details:

Property Description Example
Product Name The exact name shown in your store "Leather Crossbody Bag"
Description Product description "Handcrafted genuine leather bag..."
Price Current price in USD "$149.99"
Availability Stock status "InStock" or "OutOfStock"
Image High-quality product image URL "https://yourstore.com/image.jpg"
SKU Unique product identifier "LCB-001"
Brand Manufacturer or brand name "YourBrand"

How Schema Improves Search Results

Product schema can boost your search performance in several ways:

1. Rich Snippets

Rich snippets show extra product details directly in search results, such as:

  • Price
  • Availability
  • Review data, including star ratings and review counts

This added information makes your listings more appealing to potential customers.

2. Improved Click-Through Rates

By highlighting key product details and visual elements, product schema helps your listings stand out. Shoppers get the info they need upfront, making them more likely to click through to your store.

3. Enhanced Search Engine Understanding

Schema markup provides a structured format that helps search engines interpret:

  • Product variations
  • Pricing updates
  • Inventory changes
  • Relationships between products

This clarity ensures your product details are accurately represented in search results.

Before You Start: Store Setup

Before adding schema to your Shopify store, make sure you have access to your theme files and a backup of your current theme. This will help ensure everything goes smoothly and you can revert changes if needed.

Locating Your Theme Files

Here’s how to find and access your theme files:

  1. Go to your Shopify Admin.
  2. Navigate to Online Store > Themes.
  3. Locate your active theme.
  4. Click Actions > Edit Code.

This will open the theme editor, where you can view and modify your theme files. Typically, the product template file is in the Templates folder, while custom code snippets are stored in the Snippets folder.

Creating a Backup of Your Theme

To safeguard your theme before making changes, follow these steps:

  • From Online Store > Themes, click Actions and select Download theme file to save a .zip backup of your theme.
  • Alternatively, choose Duplicate and rename the copy to something like "Production Backup" for easy identification.

Once you’ve accessed your files and secured a backup, you’re ready to start adding product schema.

Adding Product Schema: Step by Step

Here's how to implement product schema markup effectively:

Creating a Schema Snippet

  1. Open your theme editor and find the Snippets folder.
  2. Click Add a new snippet.
  3. Name the snippet product-schema.liquid.
  4. Hit Create snippet.

This snippet will serve as a central hub for your schema code, making updates simpler.

Now, move on to adding the schema code to this snippet.

Writing Schema Code

In your newly created product-schema.liquid file, insert the following JSON-LD schema structure:

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "{{ product.title }}",
  "description": "{{ product.description | strip_html }}",
  "sku": "{{ product.selected_or_first_available_variant.sku }}",
  "brand": {
    "@type": "Brand",
    "name": "{{ shop.name }}"
  },
  "offers": {
    "@type": "Offer",
    "url": "{{ shop.url }}{{ product.url }}",
    "priceCurrency": "USD",
    "price": "{{ product.price | money_without_currency | remove: ',' }}",
    "availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}"
  },
  "image": "{{ product.featured_image | img_url: 'large' }}"
}
</script>

The Liquid variables in this code ensure that your schema data stays up to date automatically.

Once your schema snippet is ready, it's time to integrate it into your product pages.

Embedding Schema into Product Pages

To link your schema snippet to the appropriate product pages:

  1. Go to the Templates folder in your theme editor.
  2. Open either product.liquid or product-template.liquid.
  3. Find the main product container in the code.
  4. Add this line just before the closing product container tag:
{% render 'product-schema' %}

This step ensures that the schema is properly connected to each product's context.

sbb-itb-8b1a57a

Testing Your Schema

After adding schema markup, it's important to test it to ensure search engines can process it correctly. Proper testing helps connect your schema setup to better search result displays.

Using Google's Rich Results Test

Google's Rich Results Test is a reliable tool to check your schema markup:

  • Visit the tool at https://search.google.com/test/rich-results
  • Enter your product page URL or paste your code, then click "Test URL" or "Test Code"
  • Review the results for:
    • Schema validation
    • Search snippet preview
    • Detected properties
    • Any warnings or errors

Make sure essential properties like price, availability, and image are implemented correctly.

Fixing Common Problems

Here are solutions to frequent schema markup issues:

Invalid Price Format
Prices with symbols or commas can cause errors.

  • Fix: Use a filter like money_without_currency | remove: ',' to reformat prices.

Missing Image URLs
Broken or relative image paths can lead to missing data.

  • Fix: Always use absolute URLs, such as:
    {{ product.featured_image | img_url: 'large' }}

Incorrect Availability Status
Improper formatting of availability data can create problems.

  • Fix: Use schema.org URLs like this:
    {% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}
    

Multiple Schema Conflicts
Having duplicate schema code can confuse search engines.

  • Fix: Remove duplicates and ensure only one complete product schema is included.

If you're facing more complex schema issues, it might be worth consulting a Shopify development expert to optimize your store's visibility in search results.

Keeping Schema Up to Date

After testing your schema, it's crucial to keep it updated to maintain strong search performance. Ensuring your product schema remains accurate helps display the latest details and avoids showing outdated information.

Updating Product Changes

Whenever product details change, update the schema to reflect those adjustments. Key areas to focus on include:

  • Price Updates: Ensure the schema matches the latest pricing.
  • Inventory Status: Update stock availability to reflect current levels.
  • Product Descriptions: Adjust schema whenever descriptions are revised.
  • Image Updates: Replace image URLs to match the most recent product visuals.

To streamline this process, create a checklist for your team to review and verify schema accuracy each time product changes are made.

Recording Schema Updates

Keeping a record of schema changes helps you track updates and troubleshoot any issues effectively. Here's an example of how to document these updates:

Update Type What to Document Update Frequency
Price Changes New prices and implementation dates As prices change
Inventory Updates Stock status modifications Daily or Weekly
Product Details Updated descriptions and features When modified
Schema Testing Test results and fixes Monthly

This consistent documentation can prepare your store for growth and make it easier to collaborate with experts when needed.

Getting Expert Help

There are times when expert assistance is beneficial, such as:

  • Adding advanced schema features.
  • Resolving recurring schema errors.
  • Expanding your product catalog.

"Martin Monroe Creative takes a systematic approach, including discovery, planning, execution, and delivery, to ensure marketing campaigns reach the intended audience effectively"

Professional agencies can offer the technical knowledge needed to keep your schema implementation aligned with the latest best practices and search engine requirements. Their expertise can save time and ensure accuracy.

Conclusion

Using product schema can improve your visibility and boost your search rankings. When implemented and kept up to date, schema markup helps search engines display product details more effectively in U.S. search results.

Here’s why it matters:

  • Better Visibility: Rich snippets highlight key details like pricing, availability, and ratings.
  • Improved User Experience: Shoppers get important product information directly in search results.
  • Increased Click-Through Rates: Detailed snippets attract more engaged and relevant traffic.

Follow these steps to make the most of schema for your Shopify store.

"Martin Monroe Creative takes a systematic approach, including discovery, planning, execution, and delivery, to ensure marketing campaigns reach the intended audience effectively"

FAQs

How does adding product schema improve my Shopify store's visibility in search results?

Adding product schema to your Shopify store helps search engines better understand your product pages by providing structured data about your items. This can result in enhanced search results, such as rich snippets that display product prices, availability, and reviews directly in search results.

These richer search results make your store stand out, attract more attention, and can lead to higher click-through rates. By improving how your products appear in search engines, you can bring more qualified traffic to your store and potentially boost sales.

What should I watch out for when adding product schema to Shopify?

When implementing product schema on Shopify, there are a few potential risks and common mistakes to avoid to ensure everything works smoothly and enhances your SEO efforts:

  1. Incorrect or incomplete data: Make sure all required fields, like product name, price (with the correct currency format, e.g., $99.99), availability, and description, are accurately filled out. Missing or inaccurate data can lead to errors in how search engines display your products.
  2. Duplicate schema markup: Avoid adding multiple conflicting schema codes to your product pages. This can confuse search engines and negatively impact your SEO performance.
  3. Not validating your schema: Always test your schema markup using tools like Google’s Rich Results Test to ensure it’s implemented correctly and free of errors.

Taking the time to implement schema properly can boost your product visibility in search results and improve your overall SEO performance.

How often should I update the product schema on my Shopify store to keep it accurate and effective?

You should update your product schema on Shopify whenever there are changes to your product details, such as pricing, availability, or descriptions. Regular updates ensure that search engines display the most accurate and relevant information to potential customers.

Additionally, it's a good idea to review your schema markup periodically - such as every few months - to ensure it aligns with the latest SEO best practices and Google guidelines. Staying proactive can help maintain your store's visibility and search performance.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.