How to fix the canonical tag issue

Hi,

I’m facing a canonical issue on my Shopify store.

My collection pagination URLs like:

/collections/example?page=2

are also getting indexed in Google.

These paginated URLs have self-canonical tags, and I’m not able to change the canonical to point to the main collection page.

My question:

  • What is the correct way to solve this canonical issue in Shopify?

  • How can I stop ?page=2, ?page=3 pages from getting indexed while keeping products crawlable?

Any simple explanation or recommended solution would help.

Thanks
Bhanu

Of course they are self-canonical, they do have different content.
Say, if you do not have sitemap.xml, indexing these pages is the only way SE will learn about your products.

Having said that – there are several options.

You can modify your robots.txt and add something like

Disallow: /collections/*page=*
Disallow: /*/collections/*page=*

Or you can modify your layouts/theme.liquid by adding something like this right above the </head> tag:

{% if collection and current_page > 1 %}
<meta name="robots" content="noindex">
{% endif %}

Hi!

A few weeks ago, I helped a client with this and wrote an article about it on my blog. It’s in Spanish, but I hope translating it will help you: Shopify CANONICAL URL: Mejora tu SEO!【DAVID 10X】

Good luck with your project!