How canonical tags work in Shopify
Published: September 09, 2025
The area of Portland we live in sucks for giving directions.
There are a handful of streets that don't have unique names. Sometimes they are the same street but are cut up into pieces miles apart. Others are variants of other streets but with a different direction (SE vs SW).
I've lost count how many times someone was coming to our home and ended up on the opposite side of town.
Navigating websites are easier than city streets because every page has a URL that identifies it (URL literally means Uniform Resource Locator, a standardized way to find the resource/webpage).
The problem with URLs are that even if they are unique, very often there are multiple URLs with the same content. Since search engines really only care about content, this makes them think those different pages are just copies of the same page. Common ones with Shopify stores are product pages duplicated under their collections. For example:
https://www.example.com/products/sourdough-bread
https://www.example.com/collections/bread/products/sourdough-bread
There's also a ton of other pages that Shopify and your theme might create:
https://www.example.com/products/sourdough-bread?variant=8675309
https://www.example.com/collections/bread/products/sourdough-bread?variant=8675309
https://www.example.com/products/sourdough-bread?selling_plan=90210
Luckily the search engines have a fix for these duplicate pages.
The canonical tag.
What's a canonical tag and what does it do
The canonical tag is a hidden piece of code that tells search engines where the authoritative version of this page lives. In other words, which URL is the important one.
Any other page that has the same or similar content is then considered duplicate pages and irrelevant to the search engines.
Yes, you in the back shouting about duplicate content penalties? Just hold on a minute...
Looking back at our bread example URLs, if we use this canonical tag we can tell search engines that the product version is the authoritative page. We'd just need to add the tag on all of the pages and give them the URL of the product page.
Every Shopify theme I've ever seen already does this for you by default.
Example canonical URLs that Shopify uses
The canonical Shopify creates for you will follow some standard formats. They are also automatically created for each of your Shopify Markets domains.
The homepage will always be your domain https://www.example.com/
.
Collections pages will use your collection handles. They also support pagination (e.g. page 2, page 3)
https://www.example.com/collections/bread
https://www.example.com/collections/bread?page=2
https://www.example.com/collections/scones
https://www.example.com/collections/muffins
Product pages will always use the main product page URL, without any collection: https://www.example.com/products/sourdough-bread
That means collection-aware URLs, variants, selling plans, etc will never be used as the canonical. This is why we always recommend being careful how you link to products. You'll want to use the main product URL as much as possible, without the collection or variant components.
Examples of URLs not used:
https://www.example.com/products/sourdough-bread?variant=8675309
https://www.example.com/collections/bread/products/sourdough-bread?variant=8675309
https://www.example.com/products/sourdough-bread?selling_plan=90210
Pages are simple and just use the page's main URL like https://www.example.com/pages/contact
.
Same for blog categories and their pagination URLs (e.g. page 2, page 3, etc)
https://www.example.com/blogs/news
https://www.example.com/blogs/news?page=3
Blog posts include the blog they belong to and won't work at all without it. https://www.example.com/blogs/news/cat-bread
To be frank, product canonicals are the ones that matter 80% of the time.
Checking your canonicals
It used to be that you just had to trust that you had your canonicals setup or have someone to audit them across your entire site.
Google's solved that by including details about your canonicals in their URL inspector within Search Console. This tool lets you check any of your URLs and see what Google sees for its canonical as well as telling you how Google is using it.
This means you can see if a page's canonical is configured properly and pointing to the correct URL. If it's not correct, you might have some adjustments to do. You can also get my advice on how to handle these issues in Search Console.
Canonicals and duplicate content penalty
Now to get into the big "issue" most people yell about with canonicals. The duplicate content penalty.
I don't remember when SEOs first started to talk about a duplicate content penalty but they still bang on that drum today.
It's all a bunch of noise to be honest.
First off, it's not a penalty. You don't get red-carded by Google for having duplicate pieces of content. There's no content-jail your store gets thrown into until you pay to get out or roll doubles.
Second, duplicate content is not a problem for 90% of Shopify stores. Shopify and most themes do the right thing with canonicals by default. Unless you are copying-and-pasting content from place to place or stealing content from other sites, you're covered.
Quick note about stealing content: you might have stolen content inadvertently. If you used LLM AI content (which stole everyone's content) or directly copied content from a vendor, Google will detect that eventually. You're going to want to rewrite that content if you care about performing higher than your competitors.
What really happens when Google see duplicate content is they evaluate all of the places that have that same content and determine which one is the best. Their evaluation includes a lot of factors but you can just think all of those factors are just looking for the best quality.
Think about a photograph you took and printed out. The 8x10 version is probably going to be better than the 4x6 print. Both will be better than that photo of the photo your mother took or that t-shirt your aunt made with that photo iron-on paper.
Back to duplicate content, just tell Google which URL has the best version and they'll figure it out eventually.
Customizing the canonical on Shopify
Sometimes you might want to customize the canonical.
I've seen some stores create an impressive landing page that sells their product and they want that page to rank instead of the main product page. Or maybe there are some collections that are just variants of your main collection.
In these cases you might want to setup different canonicals so the primary URLs get more weight and noticed by search engines. (You can also noindex those weaker pages but oftentimes you want them still indexed to push some SEO weight, just not as the primary page).
I'll warn you right now that you must not make any mistakes here. An incorrectly coded canonical can hose those pages and potentially your entire site. Use caution with this and if you hire a coder, make sure they are competent and not some hack.
Shopify creates a variable called the canonical_url
that holds the canonical URL for the current page. Every page (technically, every request) gets a URL saved to that variable in Shopify's servers and your theme will output it into the canonical tag like:
<link rel="canonical" href="{{ canonical_url }}">
You can overwrite that canonical_url
variable with your own code but that will often break things. How do I know this? Glad you asked.
An app did this and the poor store was hosed when the app was uninstalled. Literally every single page in their store pointed to the homepage as the canonical, causing Google to start removing page after page from the search results. Luckily I spotted it while checking their structured data and they were able to remove the bad code and recover their pages.
Rather that overwrite that variable, create a different variable and customize the actual canonical tag. Kyle Risley from Shopify has a good article on how to create a custom canonical URL.
Again, 99% of the time you won't need this. Most Shopify themes are perfectly fine with the default canonical code.
The Canonical tag
This was a whirlwind tour of the canonical tag. Even though Shopify handles it well enough automatically, it pays to know how it works for when you need to change it or chase down an issue. Canonical tags are one of the behind-the-scenes tech that makes up the modern Internet that you never think about.
JSON-LD for SEO
Get more organic search traffic from Google without having to fight for better rankings by utilizing search enhancements called Rich Results.