Tuesday, January 24, 2023

How to prevent duplicate content in your Shopify store

 We’re talking about duplicate content when a product or content appears on more than one URL. This is not ideal, as Google might be confused as to which one is the main one. Therefore, duplicate content can hinder your performance in search.

Thanks to Shopify’s preference for collections, a specific product you add to a collection will be visible on two different URLs:

https://example.com/products/alien-ugly-christmas-sweater

and:

https://example.com/collections/ugly-christmas-sweaters/alien-ugly-christmas-sweater

Not ideal! Luckily, the second one is canonicalized to the first one, but this causes a headache. However, there is a way to ensure that Shopify only shows the original product URL and keeps that as the one linked everywhere.

For this, you need to edit the product-grid-item.liquid file in the Snippets folder and change the following code from (only edit code if you know what you are doing and be sure to make a backup! You should always have a duplicate of your theme ready in case of emergency):

<a href="{{ product.url | within: current_collection }}" class="product-grid-item">

to:

<a href="{{ product.url }}" class="product-grid-item">

With the new Dawn Shopify theme, this workaround is no longer needed, and it will automatically output the correct URL. For other themes or older ones, you still might want to check this workaround.

Working with product variants

Shopify works well with product variants like sizes or colors. You have plenty of options to make different combinations of whatever you like. The thing with variants, of course, is that it’s hard to get these to show in Google properly. Depending on your needs, you might not need that, but if you want the different variants of products to be indexed, you might be better off turning your variants into individual products.

Of course, you need to provide sufficiently different product descriptions and the like if you want them to turn up individually in Google.

Faceted navigation or product filters

Out of the box, Shopify comes with only a handful of filtering options for your online store — no Amazon-style mega menu for you! Luckily, there are ways of getting more filters in your navigation. There are two options: add your custom filters if you are using an Online Store 2.0 compatible theme or add an app to manage it for you.

The first option is relatively straightforward but might be limited, while the second option opens up a world of possibilities. Product filter apps give you more control over how you want to categorize and visualize the faceted navigation. In addition, they also come with intelligent options that make it easier to load filters based on loads of variables dynamically.

Whatever you pick, just make sure that the parameters generated by the faceted navigation don’t end up in the search results pages — block them in the robots.txt liquid file with a disallow rule.

Here’s an example of a faceted URL :

https://www.allbirds.com/collections/mens?bestFor=everyday&hue=red&material=wool

No comments:

Post a Comment

Electronics Computer

Are you currently in search of a job? Look no further! Americas Technician Services is always on the lookout for talented individuals like y...