How can I effectively remove the canonical tag from certain product pages?

How can I effectively remove the canonical tag from certain product pages?

interiorexpert
Tourist
10 0 4

Hi together,

I want to remove the canonical tag from some product pages, but it does not work. I am able to change the canonical URL, but deleting doesn't work.

If I change the code in theme.liquid like that, it works:

{% if handle contains 'pmc' %}
    <link rel="canonical" <link rel="canonical" href="https://www.pazls.de/test"/>
    {% else %}
    <link rel="canonical" href="{{ canonical_url }}"/>
{% endif %}

On pages containing the URL handle 'pmc' the canonical URL is https://www.pazls.de/test

 

If I change the code like that, I would expect that there is no canonical tag anymore:

{% if handle contains 'pmc' %}
    
    {% else %}
    <link rel="canonical" href="{{ canonical_url }}"/>
{% endif %}

 But it doesn't work (also when I use a solution with %unless% instead of the solution above). I can still see a canonical tag with {{canonical_url}} in the code. 

 

Why can I still see a canonical URL? And how can we remove it?

 

 

For explanation why we are doing that. We are marking pages containing URL handle 'pmc' as no index:

{% if handle contains 'pmc' %}
<meta name="robots" content="noindex">
{% endif %}

We don't want to confuse crawlers. It doesn't make too much sense to mark something as 'noindex' and having a canonical tag at the same time...

 

Thanks for your help in advance :). 

Replies 11 (11)

safetyglasses
Excursionist
15 0 4

Hi, Canonical tags affect SEO from two points of view. For once, they directly influence how search results display. They can also influence the general rankings of a website due to multiple factors, such as structure, user experience and PageRank flow. 

  1. In the main menu, click Administration  Settings> Advanced >System >Content Locations.
  2. Deselect Disable canonical URLs checkbox. For new sites, the checkbox is deselected, by default.
  3. Click Save changes.
  4. Perform one of the following:
interiorexpert
Tourist
10 0 4

@safetyglasses thanks for your answer 🙂

 

Unfortunately I cannot find the path you described. When I click on settings in the main menu I cannot see "Advanced". On which Shopify plan are you?

drakedev
Shopify Partner
696 150 239

If you are settings meta noindex, there's no need to remove the canonical url. Google will not index your page.

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
interiorexpert
Tourist
10 0 4

Yes it's not getting indexed, but our SEO expert says it's not good because it sends contradictory signals to the crawler, so it maybe affects the ranking.

Nevertheless I would be interested why Shopify doesn't allow that there's no canonocial URL.

drakedev
Shopify Partner
696 150 239

Talk with your SEO expert, if a page is indexed, it should have also a canonical.

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
interiorexpert
Tourist
10 0 4

Hi @drakedev, thx for your answer.

The topic is about pages NOT being indexed and having a canonical at the same time in Shopify

interiorexpert
Tourist
10 0 4

Is there any SEO expert that also does not want to have a canonical tag for pages that are not indexed, and knows a solution for that?

The Shopify support told me to ask a Shopify expert, but it seems that this a technical issue that can only be solved by Shopify itself...

Matei86
Excursionist
21 0 5

I'm an SEO expert and I can confirm that a canonical tag should NOT be present on noindex pages. Even if I'm removing <link rel="canonical" href="{{ canonical_url }}"> completely, the canonical tag is still displayed. Shopify team, is there a solution to this?

Joseph1122
Visitor
1 0 0
  • To turn on canonical links for all static pages, click Administration » Settings » Advanced » System » Content Locations » Page Default Canonical Url Settings and select Enable Pages default canonical URL tag checkbox.
  • To turn on canonical links for an individual static page, perform the following:
    1. Open the Actions menu of the Page and then choose Title & Properties.
    2. Expand the Advanced options section.
    3. In the Canonical Urls dropdown box, select whether you want to enable or disable canonical URLs for the page. 
Amantrika
Not applicable
1 0 0

I can not find these option can you please help share a screenshot or something