How can I change the canonical tags on my website pages

New Member
2 0 0

Hello,

I am a store owner and currently I am trying to Search engine optimize my site. I was checking the canonical tags on evey page of my site and found that some pages have canonical URLs mistakenly assigned. for example a bed sheet set page has cannoical tag to the quilt cover collection page, while the right assignment will be for the bed sheet sets collection page. Do any one know how to change the mistakely assigned canonical tag? where do I enter the code as I have checked theme.liquid and found only this: <link rel="canonical" href="{{ canonical_url }}" />

Thanks

0 Likes
Shopify Expert
9764 86 1512

Do you have an example of a page where the canonical url is not correct? Let's start with a link and then we can look at other options.

If there is a bug, then you'd want to raise it with the support team. Seeing a link to the page will help look at the html source and know if there's a bug or not.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
New Member
2 0 0

for example this link is ok:

https://www.isador.com.au/collections/quilt-covers/products/off-white-quilt-cover-set if you checked it you will find that the canonical tag points back to the quil cover collection, where the product page actually belong.

on the other hand this product which is a flat sheet:

https://www.isador.com.au/collections/bed-sheets/products/oyster-sheet-set?variant=32856093970

points to the quilt cover collection while it should point back to the sheet set collection.

This sheet set page 

https://www.isador.com.au/collections/bed-sheets/products/green-mint-sheet-set?variant=32856164754

points correctly to the sheet set collection page.

Thanks in advance.

 

0 Likes
Shopify Expert
9764 86 1512

That first link...

https://www.isador.com.au/collections/quilt-covers/products/off-white-quilt-cover-set

... has the canonical url of:

https://www.isador.com.au/products/off-white-quilt-cover-set

This is correct. The product is the base url - not the collection url so things are working as they should be.

-------------------

The second link...

https://www.isador.com.au/collections/bed-sheets/products/oyster-sheet-set?variant=32856093970

... has the canonical url of:

https://www.isador.com.au/products/oyster-sheet-set

also looks good so far.

-------------------

The third also points back to the base product. I'm not seeing an issue here.

 

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Partner
5 0 1

HI @Jason

 

as far as I know would it be better for SEO to have all product canonical with the "category"-path and not with the direct product path because no product path is linked within the site. 

 

So e.g. 

 

For the first link: 

https://www.isador.com.au/collections/quilt-covers/products/off-white-quilt-cover-set 

would the best canonical be: 

https://www.isador.com.au/collections/quilt-covers/products/off-white-quilt-cover-set  and not 

https://www.isador.com.au/products/off-white-quilt-cover-set

 

Best regards

Lars

 

 

 

 

 

1 Like
Tourist
11 0 2

Can Anyone can help?
How to add a custom canonical tag on page A so that search engine will prefer to display the listing of page B on SERP?

A: https://shopmtn.eu/products/doughty-35mm-atom-hook-clamp
B: https://shopmtn.eu/products/doughty-32mm-atom-hook-clamp

 

Where I should put this code? on the individual product page?
<link rel="canonical" href="{{canonical_url}}">

 

Thanks a million

Iky

0 Likes
New Member
2 0 0

I'm looking for the same solution of Lars.

But Shopify seems a "closed environment" so I don't think you change nothing at all in your canonical links.

It's the same for the robots.txt, .htaccess and for sitemap.xml

Shopify's not for a serious SEO work...

0 Likes
New Member
2 0 0

Agree with @Lars, The /product/product-name is not search/user friendly it just makes sense to the shopify system. We need the ability to choose or change what {canonical.url} gives us.

0 Likes
Shopify Expert
9764 86 1512

Can Anyone can help?
How to add a custom canonical tag on page A so that search engine will prefer to display the listing of page B on SERP?

A: https://shopmtn.eu/products/doughty-35mm-atom-hook-clamp
B: https://shopmtn.eu/products/doughty-32mm-atom-hook-clamp

 

Where I should put this code? on the individual product page?
<link rel="canonical" href="{{canonical_url}}">

 

Thanks a million

Iky


If you're looking to use a different canonical url then what Shopify defaults to you can take control as you need.

It requires some tinkering, but if it's important to your strategy you may want to look into it.

 

So two steps:

 

  • adding a metafield to a product defining what the new canonical should be
  • altering the theme code so it uses the url in the metafield and not what Shopify suggests via the {{canonical_url}} code.

This doesn't address the later posts talking about (what I assume to be) removing "/products" from the Shopify url structure but does answer the comment quoted.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Shopify Partner
5 0 1
Hi guys,

Sorry for the late response. is right, you can change it. You can use metafields - but what I think is really „static“ and not very user friendly. So I looked for a solution where I don’t have to add 500 canonical links in metafields. I added a if-else clause to the canonical tag. Which says: please take the first category name of this product (if this is assigned to multiple categories) and add the product-unique name.


Here is a example from my shop: www.exotischerleben.de

Would be interested what do you think. We’re running quite good with this solution but always open to improve things:

<link rel="canonical" href="{{shop.url}}/collections/{{ product.collections[1].handle}}{{product.url}}" />


Sorry i am on my phone and it is not that easy to get this sorted. Hope that helps. Otherwise send me a IM or Email me: Lars-Leenen@web.de

Best regards
Lars
0 Likes