canonical tags

Solved
mishania
Visitor
2 0 0

Hello, Need your help, please

can someone explain to me please how can I add a canonical tag to my product page?

Accepted Solution (1)
Elle
商店ify Staff
商店ify Staff
1092 99 206

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? ClickLiketo let me know!
- Was your question answered? Mark it as anAccepted Solution
- To learn more visit the商店ify Help Centeror the商店ify Blog

View solution in original post

Replies7(7)
Elle
商店ify Staff
商店ify Staff
1092 99 206

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 URLsare the authoritative or primary URL that's served to Google. Usually, they're the shortest URL. In the above example, thesecondURL 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? ClickLiketo let me know!
- Was your question answered? Mark it as anAccepted Solution
- To learn more visit the商店ify Help Centeror the商店ify Blog

mishania
Visitor
2 0 0

So i dont need to worry that my product pages are almost the same?

Elle
商店ify Staff
商店ify Staff
1092 99 206

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? ClickLiketo let me know!
- Was your question answered? Mark it as anAccepted Solution
- To learn more visit the商店ify Help Centeror the商店ify Blog

amragl
Tourist
3 0 1

嗨,艾丽,

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.

larisanozhovnik
Visitor
2 0 0

我试图解决这个问题发生到黎明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 %}

{% endif %}

The code should be added to the head section of the HTML (theme.liquid). Specifically, it should be added between theandtags. Just find this line of code: and replace it with the piece of code above.

MomMeAndMore
Tourist
3 0 0

Did this work and are you using Dawn theme?

larisanozhovnik
Visitor
2 0 0
Hi!
Thank you for your question.
I am in the process of testing this code on my website based on the Sense
theme.
And I have updated it a little bit.
The updated one looks like below:

{% if template == 'product' %}
{% assign first_variant = product.selected_or_first_available_variant %}
{% assign canonical_url = product.url %}
{% if first_variant %}
{% assign canonical_url = canonical_url | append: '?variant=' | append:
first_variant.id %}
{% endif %}

{% endif %}

With regard to the use of the Dawn theme, I help one of my partners with
SEO and he uses two websites based on this theme. He is also testing this
code on his websites.