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.

Related: Customize a Collection Page in Shopify.

Related: Create a Collection Page in Shopify.

Related: Add Structured Data in Shopify.


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

Related: Fix 404 Pages in Shopify.


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:


FAQ

Do I need to add canonical tags manually in Shopify?

No, in almost all cases. Shopify adds canonical tags automatically to every standard page type. Manual overrides are only needed when you have a confirmed duplicate-content issue that Shopify's defaults don't handle — like a custom page that mirrors content from another URL. To override safely, describe the canonical you want to Fudge ("set the canonical of /pages/spring-2026 to /collections/spring") and it injects the right <link rel="canonical"> into the page's <head>.

Why is Google ignoring my Shopify canonical tag?

Google treats canonical tags as a hint, not a directive. If the page Google chose as canonical has stronger signals (more inbound links, more user engagement, a more authoritative URL), it may pick that one instead. Search Console's URL Inspection tool will show you which canonical Google selected and why.

Can I add a self-referencing canonical to a Shopify page?

Shopify already does this by default - every product, collection, and page has a canonical pointing to itself. You don't need to add one manually. If you're seeing missing or incorrect canonicals, check theme.liquid in case a previous edit removed the default tag.

Do collection filter URLs need canonical tags?

They get one automatically. Filter URLs like /collections/all?filter.p.tag=summer are canonicalized to the base collection URL by default, which is correct - filtered views are usually not pages you want indexed separately.

How do I check the canonical tag of a Shopify page?

Right-click on the page → "View page source" → search for canonical. You'll see a <link rel="canonical" href="..."> tag in the <head>. To audit at scale, use Screaming Frog (free up to 500 URLs) or your SEO platform's site crawl.

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

You might also be interested in

How to Add Structured Data in Shopify (2026)
Learn what structured data Shopify adds automatically, how to add FAQPage schema for rich results, and when to add custom schema markup.
How to Edit Meta Titles in Shopify (2026)
How to change meta titles in Shopify for products, collections, pages, and your homepage. Includes character limits and bulk editing methods.
How to Edit Meta Descriptions in Shopify (2026)
How to edit meta descriptions in Shopify for products, collections, pages, and your homepage — plus bulk editing with Matrixify or CSV.