UKDan Member
Last edited 7 months ago

2882 duplicate meta descriptions of collections with more than one page This post is outdated


I'd really appreciate some help from someone who knows how to solve this please!

I was using the standard Shopify suggestion for canonical url in theme.liquid as described at https://help.shopify.com/themes/development/getting-started/search-engine-optimization of:

<link rel="canonical" href="{{ canonical_url }}" />

 However this resulted in every tagged page (and pages 2/3/4 etc of a collection) being indexed (or rather, used as the canonical), as duplicate content.

I replaced the above code with the following which has been suggested a lot around the web...

 {% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}

and this has solved the tagged pages being used as a canonical issue but the pages issue remains.

Search Console is showing me 2882 duplicate meta titles, which is where each page in a collection is being used as the canonical url, as an example all of the following are showing as the canonical url when you 'view page source': (on their own pages, not all on one page)






As these are all the same collection they have the same meta titles and descriptions...

is there a simple drop of code to sort this please?

The reason I am confused is that in a recent forum post a Shopify employee told me that anything past the /collection-name is considered a tag, and as I am removing tags in the canonical code is shouldn't show (thats how I understand it anyway).

Here is what was said:

Essentially, Shopify's URLs are structured in a particular way. When it comes to collection pages, they all look like: yourdomain.com/collections/collection-name. If there is anything added past the collection name, such as yourdomain.com/collections/collection-name/example, Shopify is designed to filter the collection in question with the extension at the end of the URL which it sees as a tag. 

and here is link to the forum post: https://ecommerce.shopify.com/c/shopify-discussion/t/removing-tags-redirecting-url-nightmare-400683 

Any help with this would be great as its so frustrating, i have tried live chat support but was told 'Gurus' don't help with coding....



Edit: In case its useful, this is the code I have in theme.liquid for titles and descriptions:

    {{ page_title }}{% if current_tags %} &ndash; tagged "{{ current_tags | join: ', ' }}"{% endif %}{% if current_page != 1 %} &ndash; Page {{ current_page }}{% endif %}{% unless page_title contains shop.name %} &ndash; {{ shop.name }}{% endunless %}

  {% if page_description %}
  <meta name="description" content="{{ page_description | escape }}">
  {% endif %}


Thanks in advance



Alexis Shopify Employee
7 months ago

Hey Dan,

Alexis here from Shopify Support!

I'm just moving your post over to our Shopify Design forum. This is the best place for coding and theme queries so you should hear from one of our experts soon.

If you need anything else, feel free to reach out to our Support, available 24/7 !

Warm regards,

Alexis | Shopify Guru