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 oftheme.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:
- Homepage - points to
https://yourstore.com/ - Products - points to
https://yourstore.com/products/product-slug - Collections - points to
https://yourstore.com/collections/collection-slug - Pages - points to
https://yourstore.com/pages/page-slug - Blog posts - points to
https://yourstore.com/blogs/blog-name/post-slug
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:
/collections/mens/products/leather-wallet/collections/accessories/products/leather-wallet/products/leather-wallet
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.
When NOT to override canonical tags
Don’t override canonical tags unless you have a specific, confirmed problem. Incorrect canonical tags can:
- Suppress the ranking of the very pages you’re trying to help
- Confuse Google’s understanding of your site structure
- Create signals that contradict your sitemap
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:
- Pages where the canonical points to a different URL than the page you’re on (may or may not be intentional)
- Pages with no canonical tag (shouldn’t happen with modern Shopify themes, but worth checking)
- Pages where the canonical points to a 404 URL (a real problem)