SEO: Remove Canonical URL

interiorexpert
Tourist
6 0 1

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 8 (8)
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
6 0 1

@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
598 128 163

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

• If my answer helped click Like to say thanks
• If the problem is solved remember to click ✅ Accept Solution
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
interiorexpert
Tourist
6 0 1

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
598 128 163

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

• If my answer helped click Like to say thanks
• If the problem is solved remember to click ✅ Accept Solution
• Shopify/Shopify Plus custom development, optimization and consulting. You can hire me here.
interiorexpert
Tourist
6 0 1

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
6 0 1

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...