How to Add Canonical Tags in Shopify (2026)

Last updated
Expert reviewed
5 min read
Jacques Blom
Jacques Blom
CTO at Fudge.

Key takeaways

  • Shopify adds canonical tags automatically to all standard pages - you usually don’t need to touch them.
  • Problems arise with product variants, collection pagination, and duplicate content from multiple collection paths.
  • To override a canonical tag, edit the <head> section of theme.liquid.
  • Know when to leave Shopify’s auto-canonicals alone - incorrect overrides can cause more harm than the original issue.

A canonical tag (<link rel="canonical">) tells search engines which version of a page is the “official” one. This matters when the same (or very similar) content is accessible from multiple URLs — a common situation in e-commerce.

Does Shopify add canonical tags automatically?

Yes. Shopify’s standard themes add canonical tags to every page type:

To verify what canonical tag your store is using, visit any page → right-click → View Page Source → search for canonical. You’ll see something like:

<link rel="canonical" href="https://yourstore.com/products/example-product" />

For most stores, Shopify’s automatic canonicals are correct and should be left alone.


When Shopify’s canonical tags cause problems

Product variants

Shopify product variants create URLs like /products/t-shirt?variant=12345. By default, Shopify canonicalizes all variants to the base product URL (/products/t-shirt), which is correct behavior — you don’t want Google indexing every size and color combination as a separate page.

When this is a problem: if a variant is so different from the base product that it deserves its own page (different product name, significantly different content), the canonical pointing to the base product may suppress it. Solution: create a separate product rather than a variant.

Products accessible via multiple collection paths

In Shopify, a product can appear in multiple collections. This creates multiple URLs:

Shopify sets the canonical to /products/leather-wallet (the direct product URL) regardless of which collection path is used. This is the correct behavior — Google consolidates ranking signals to the canonical URL.

Collection pagination

When a collection has multiple pages, Shopify generates URLs like /collections/all?page=2, /collections/all?page=3, etc. These are all canonicalized to the base collection URL (/collections/all).

The concern: Google should still be able to crawl paginated pages to discover all your products. Using rel=“next” and rel=“prev” for pagination was deprecated by Google in 2019 — just make sure paginated pages are linked normally and Google will crawl them.

The ?sort_by parameter

When shoppers sort collections (by price, best selling, etc.), Shopify generates URLs like /collections/all?sort_by=price-ascending. These are canonicalized to the base collection URL — correct behavior.


How to override a canonical tag in Shopify

If you need to set a custom canonical for a specific page type, edit theme.liquid in your code editor.

Step 1 - Duplicate your theme. Always work on a copy.

Step 2 - Find the canonical tag. Online Store → Themes → Actions → Edit code → open theme.liquid. Search for canonical to find the existing tag.

Step 3 - Modify the logic. The canonical tag is usually set with Liquid like:

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

To override for a specific template:

{% if template == 'page' and page.handle == 'your-specific-page' %}
  <link rel="canonical" href="https://yourstore.com/pages/canonical-version" />
{% else %}
  <link rel="canonical" href="{{ canonical_url }}" />
{% endif %}

This is the kind of change that Fudge can make for you — describe the override you need and it generates the Liquid code for review.

Fix Shopify SEO issues by describing what you need.
Try Fudge for Free

When NOT to override canonical tags

Don’t override canonical tags unless you have a specific, confirmed problem. Incorrect canonical tags can:

Before overriding, use Google Search Console to check whether Google has selected a different canonical than the one you specified. If Google ignores your canonical, that’s a signal your content genuinely appears duplicate and the issue needs to be solved at the content level, not just with a tag.


Checking canonical tags across your store

Use a site crawl tool (Screaming Frog free tier allows 500 URLs) to export all canonical tags across your store. Check for:

Jacques's signature
Fix Shopify SEO issues by describing what you want fixed.

You might also be interested in

How to Fix 404 Pages in Shopify (2026)
Fix 404 errors in Shopify by setting up URL redirects. How to find 404s in Google Search Console, add redirects individually, and bulk import via CSV.
How to Edit Meta Titles in Shopify (2026)
Learn how to change meta titles in Shopify for products, collections, pages, and your homepage
How to Edit Meta Descriptions in Shopify (2026)
Learn how to edit meta descriptions in Shopify for products, collections, and pages