Solved

How to use canonical tags or redirects for identical products with different URLs?

Eregg
Tourist
5 0 1

Hello,

 

we sell paints and oils for the DIY sector. 

 

We have structured the shop in a way that allows customer to reach the same product through different click routes. E.g. you can find wood oil in the category "oils" as well as in "products for wood". The leads to different URLs for the identical product which is bad for SEO.

 

For the example above I found at least 3 different URLs:

 

https://berico-farben.de/collections/holzole/products/roko-pflegeoel-fur-innen-und-aussen

https://berico-farben.de/collections/fur-holz/products/roko-pflegeoel-fur-innen-und-aussen

https://berico-farben.de/products/roko-pflegeoel-fur-innen-und-aussen

 

How can I either create permanent redirects in order to focus on only one URL or otherwise use the canonical tag for Google?

 

What is the best way to tackle this issue?

 

Thank you,

Eric

Accepted Solution (1)
JoesIdeas
Shopify Expert
2263 207 599

This is an accepted solution.

I think you just need this:

<link rel="canonical" href="{{ canonical_url }}">

 

Inside the <head> section of theme.liquid - that file loads on every page of your site.

 

With that in place, you can then view the source code on various pages on the site (go to any page, then right click and select "view page source" (that's for chrome but any browser should be similar)), and you can see how the canonical url is populated by searching <link rel="canonical

 

I'm not current on SEO best practices so can't really give good advice about search console stats, but with the canonical links loading on every page that should instruct search crawlers to the canonical url.

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks

View solution in original post

Replies 10 (10)

JoesIdeas
Shopify Expert
2263 207 599

Are you seeing problems in SEO software or google search console?

 

Most modern Shopify themes I've seen already have canonical urls implemented but if yours doesn't this will help: https://www.shopify.com/partners/blog/canonical-urls

 

Basically you just need to insert some simple code into the <head> in your theme.liquid file so that those collection landers point back to the original product page.

 

I would start by reading that guide + checking your theme.liquid file to see if you're already setup (or asking your developer if you have one).

 

If you want to check in SEO software a couple tools I like for stuff like this are Screaming Frog and Ahrefs.

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
Eregg
Tourist
5 0 1

Hello Joesideas, 

thank you a lot for helping out!

I came up with the problem because I saw in Search Console that a couple of pages are indexed that are less relevant than others. That was when I noticed that the very same product can have multiple URLs in Shopify, which makes no sense and is not helpful with SEO as far as I know. 

 

I checked the code from the head of the website. I think it doesn't contain code that deals with the canonical tag.  Couldn't find the term. The theme is rather new however, it's called Canopy. 

You wrote that I just have to add simple code in the <head>. Is this also the case with my examples above? Because it's not about www.berico-farben.de vs. https://berico-farben.de etc. That does already work I think. 

 

I read the article that you posted. Thank you. It explains well options that there are, but not really how I finally add the {{ canonical_url }} into each specific product page.  

 

I wonder that this problem must occur to basically everybody who uses Shopify. Am I just making up a problem here or is it really something that should be tackled?

 

Thank you,
Eric

 

JoesIdeas
Shopify Expert
2263 207 599

This is an accepted solution.

I think you just need this:

<link rel="canonical" href="{{ canonical_url }}">

 

Inside the <head> section of theme.liquid - that file loads on every page of your site.

 

With that in place, you can then view the source code on various pages on the site (go to any page, then right click and select "view page source" (that's for chrome but any browser should be similar)), and you can see how the canonical url is populated by searching <link rel="canonical

 

I'm not current on SEO best practices so can't really give good advice about search console stats, but with the canonical links loading on every page that should instruct search crawlers to the canonical url.

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
Eregg
Tourist
5 0 1

Hello JoesIdeas,

 

thank you for explaining in more detail what to do. 

 

I am not sure I understand the concept of this solution. Would it not be necessary to tell on each and every page which exact duplicate page should be the canonical one?  If so, how can I do that?

 

Thank you,

Eric

JoesIdeas
Shopify Expert
2263 207 599

That's what that code snippet does.

 

theme.liquid loads on every page, and {{ canonical_url }} is a liquid variable (more about liquid here https://shopify.dev/api/liquid/objects) that inserts the canonical url (aka the original url, the one that should be crawled).

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
Eregg
Tourist
5 0 1

Thank you for getting back! 🙂

I still don't get, how Google would know which URLs are the canonical ones if I simply put the same tag on every page? I mean it doesn't give information at all if I just add this: 

link rel="canonical" href="{{ canonical_url }}">

Or do I have to change something? 

JoesIdeas
Shopify Expert
2263 207 599

It's a liquid variable it will insert the actual canonical url on the page that you are on. Just put the code in and view the source code and you'll see the canonical url populated, that's the best way to see what it does.

 

I confirmed this works:

 

Screen Shot 2022-10-20 at 2.57.38 PM.jpg

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks
Eregg
Tourist
5 0 1

Hello JosIdeas, 

 

I put the snippet in the head of my theme and found out, it's already there. 

 

And obviously it works just as you said. 

 

The canonical URL always is: https://berico-farben.de/products/product-xxx"

 

Thank you a lot for your help!!

 

Eric

 

scaledon
Shopify Partner
1 0 0

Hi Joe,
I have the same issue. But I want to actually fix it, not just add a canonical tag (which I did). 
How can I have one single URL for my products (domain.com/products/name) instead of multiple URLs for the same product? 
Thank you. 

JoesIdeas
Shopify Expert
2263 207 599

Using canonical urls is fixing it, this is common practice on the internet (another example is somewebsite.com vs www.somewebsite.com...  they're the same location but have different urls).

 

I don't believe there's a way to have 1 single product url, or at least it would not be a good idea in my opinion.

 

The navigation format uses /collections/collection_name/product so you can show users organized collections of products. So there will always be multiple urls for your products, assuming that you want to keep using collections.

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks