fbpx

How to fix your Shopify product URL structure for better SEO performance

Shopify’s native product URL structure is less than ideal for SEO.

This is the most common SEO issue out of the box with Shopify

It will create multiple URLs for each product depending on which collection it is in. 

This means you have multiple, duplicate URLs for every product – which can harm your potential rankings.

Shopify tries to handle this product URL structure through canonicalisation (rel=canonical).

However, all internal links point to the canonicalised product pages meaning it’s unlikely Google will pay attention to them. 

Visualising the Shopify product URL issue

It’s not always easy to fully understand more technical issues, but this one can be made quite clear. 

Before fixing the product URL structure, you can see how Google has to go through needless extra steps to get to the final destination of your products.

They end up deep within the product structure making it more difficult to rank.

Image credits: the incredible Matt Tutt

Conversely, once you make the fix you can see how clean your website looks from an structure perspective.

The means Google and other search engines will be able to crawl your website much easier and increase your opportunity to rank.

How to fix the Shopify URL structure?

Fortunately, there is quite an easy fix in my themes.

You can fix this by editing the collection-template.liquid and removing the collection reference from where the hrefs are being generated. 

Easy.

Here’s how… 

Start in your Shopify dashboard by going to Online Store > Themes > Customize > Theme Actions > Edit Code > Snippets > product-grid-item.liquid:

Find the text that says “within:collection”

And delete it. 

It’s that simple.

Hit Save and all your links should be fixed. 

Just be careful to remove all instances, sometimes your theme may have multiple links or have a slightly different structure.

With that 5 minute fix, your product URLs will be cleaner and more easily accessible by Google.

This is always the first thing I do for Shopify clients.

Common questions about Shopify Product URLs

Can you remove the /products/ from product URLs in Shopify?

Unfortunately, at the time of writing the answer to this is no – they are fixed and no way of removing this.

Can you use sub-directories / sub-folders for international stores on Shopify? 

Yes! A long time coming but you can now use sub-folders for international stores. This announcement excited the hell out of me.

What’s the best approach for international store URLs on Shopify? 

Where possible, use sub-folders. It helps you leverage the authority of the main domain across all of your markets.

Can you create any pages on the root on Shopify?

Alas not, all pages have some kind of subfolder, either /pages/, /collections/ or /products. 

6 thoughts on “How to fix your Shopify product URL structure for better SEO performance”

    1. Hey Leona. Looking at your site – you don’t have the product URL structure issue so you’re all good already.

  1. Hi Freddie,

    Just wondering if you know what to do in our situation? Our collections template is JSON rather than .liquid. Our site is clickk.co.uk

    Thanks,
    Jack

    1. Hey Jack. Looking at your site you don’t have the product URL structure issue. So either you’ve already fixed it or don’t need to worry.

  2. Hi Freddie, great instructions thank you. I need to do this for a client’s site but they don’t have the product-grid-item.liquid you mention. They have a partial–product.liquid file and I’ve found this within it:
    {% comment %} Variables {% endcomment %}
    {% assign available = product.available %}
    {% assign url = product.url | within: collection %}
    {% assign title = product.title %}
    {% assign vendor = product.vendor %}
    {% assign vendor_url = product.vendor | url_for_vendor %}
    {% assign price = product.price | money %}
    {% assign price_varies = product.price_varies %}

    Can you let me know if this is the right file and which bit to delete if so? Thanks so much.

    1. Hey Charlotte

      From looking at that, I’d say you’d want to change {% assign url = product.url | within: collection %} to {% assign url = product.url %}

      Always save the existing code and be ready to put it back in if it breaks anything – or better yet test it not on live.

      Freddie

Leave a Comment

Your email address will not be published. Required fields are marked *