All things Shopify and commerce
Hello, Need your help, please
can someone explain to me please how can I add a canonical tag to my product page?
Solved! Go to the solution
This is an accepted solution.
Hi, @mishania
That's correct!
You do not need to worry about this as the way our themes are built ensure that duplicate content will not be indexed by Google.
Elle | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hi, @mishania
Are you using a theme from our theme store? If so, you do not need to worry about adding canonical tags!
We've built-in Google-friendly canonical URLs, so your SEO is not impacted by "duplicated" content.
On the internal, it's common for the same content to be accessed through multiple URLs. For example, there are two ways to access the mug in this storefront:
Canonical URLs are the authoritative or primary URL that's served to Google. Usually, they're the shortest URL. In the above example, the second URL is the one that would be picked up by Google.
We have a canonical URL for all URLs at Shopify (products, collections, pages, and blogs), so there is no risk of duplicate content.
I hope this helps!
Elle | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
So i dont need to worry that my product pages are almost the same?
This is an accepted solution.
Hi, @mishania
That's correct!
You do not need to worry about this as the way our themes are built ensure that duplicate content will not be indexed by Google.
Elle | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hi Elle,
I have similar issues where the categories+filters seem to be causing duplicates and I am using a Shopify theme.
https://www.fiechi.com/collections/baby-gifts/red
https://www.fiechi.com/collections/baby-gifts/blue
This is being highlighted by a SEO tool I am using.
Should I not worry then? Or should I use the canonical tags? if so, how do I do it?
Thank you.
I am trying to fix this issue which occurs to Dawn and Sense themes as well but the solutions I found on the web did not resolve this issue. I have asked Chat GPT to suggest the code which follows. I am testing it now.
{% if template == 'product' %}
{% assign first_variant = product.variants.first %}
{% assign canonical_url = product.url %}
{% if first_variant %}
{% assign canonical_url = product.url | append: '?variant=' | append: first_variant.id %}
{% endif %}
<link rel="canonical" href="{{ canonical_url }}">
{% endif %}
The code should be added to the head section of the HTML (theme.liquid). Specifically, it should be added between the <head>
and </head>
tags. Just find this line of code: <link rel="canonical" href="{{ canonical_url }}"> and replace it with the piece of code above.
Did this work and are you using Dawn theme?
User | RANK |
---|---|
48 | |
46 | |
39 | |
28 | |
21 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023