How to fix the canonical tag issue

Topic summary

Main issue: Shopify collection pagination URLs (e.g., /collections/example?page=2) are being indexed by Google. These paginated pages use self-referencing canonical tags, and the poster cannot change them to point to the main collection URL.

Key questions:

  • What is the correct best practice in Shopify for handling canonicals on paginated collection pages?
  • How to prevent ?page=2, ?page=3, etc. from being indexed while still allowing product pages to be crawled?

Technical context: A canonical tag signals the preferred URL to search engines. Self-canonicals on paginated URLs can cause those pages to be indexed separately, which the poster wants to avoid. The example URL format was provided in a code snippet and is central to the issue.

Outcome/status: No solutions or decisions yet. The thread is open and seeking simple, recommended approaches.

Summarized with AI on December 17. AI used: gpt-5.

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 %}
1 Like

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!