# Shopify Canonical Tag: Check and Change It

Source: https://crawlcove.com/blog/shopify-canonical-tag
Published 2026-11-25 · By Lewis Jones

> What the canonical tag named on 45 live Shopify stores, URL type by URL type, when to override it, and how to set your own with a metafield.

## Key takeaways
- Shopify themes write the canonical tag for you with the canonical_url Liquid object, so you do not need to add one
- On 45 live Shopify stores, every product, variant link, tracking link, sorted collection and page named the right URL, and no store named its myshopify.com address
- Collection paths to a product either served the product with a canonical to /products/ or redirected there
- Override the default only for a real duplicate, such as a product sold on two of your stores, using a URL metafield and a small edit to theme.liquid
- Crawl the store after any theme or app change, because the faults we found came from themes and apps, not from Shopify

A Shopify canonical tag tells Google which address is the real one for a page that can be reached at several. Shopify themes write it for you: one line in `theme.liquid` prints the `canonical_url` Liquid object on every page, and that object already strips variant, tracking and sort parameters and maps collection paths back to the product. On the 45 live stores we checked, the default named the right URL on every page type we requested.

So most stores never need to touch it. This post shows what the tag named on those stores, URL type by URL type, the few faults we found, when an override is worth making and how to make one with a metafield. For which Shopify duplicates the canonical does not cover, such as tag and vendor pages, see [Shopify duplicate content](https://crawlcove.com/blog/shopify-duplicate-content). For the rest of a store audit, see the [Shopify SEO audit](https://crawlcove.com/blog/shopify-seo-audit).

## Where Shopify's canonical tag comes from

Open Online Store, Themes, then Edit code on your live theme, and search `layout/theme.liquid` for `canonical`. In Shopify's own themes, Dawn included, the line is:

```liquid
<link rel="canonical" href="{{ canonical_url }}">
```

`canonical_url` is a Liquid object Shopify fills on every request. Shopify's guidance is that its own themes set a canonical on all pages and good third-party themes should too. Some themes print it from a snippet such as `snippets/meta-tags.liquid` rather than `theme.liquid`, so if the layout file has no match, search the whole theme for `canonical_url`. If nothing prints it, add the line above inside `<head>`.

An SEO app or a snippet pasted into the theme can add a second canonical. That is the first thing to check when a store has two.

## What 45 live stores served

We started from 54 well-known Shopify brand stores and read the canonical tag on each URL type below on 25 November 2026, at one request every two seconds per store. 45 stores answered the product requests, and those 45 are the counts here. The other nine refused our crawler with a 403, would not serve the sitemap we picked products from, or redirected every product to a country subfolder.

**Figure:**
src: /media/blog/shopify-canonical-tag/live-stores.webp
alt: Table of nine Shopify URL types and what their canonical tag named on 45 stores. Product: itself on 45. Product with a utm tracking parameter: the clean product on 45. Variant link: the clean product on 45. Product under /collections/all/: 22 served it with a canonical to /products/, 23 redirected to /products/. Collection: itself on 45. Collection sorted with sort_by: the unsorted collection on 45. Collection page 2: itself with ?page=2 on 42, page 1 on 3. /collections/all: itself on 45. Page: itself on 45
label: 45 stores
inline: html
caption: Not one store named its myshopify.com address, a relative URL or a URL on another host.
aspect: 1400/651

Every row is what Shopify's default produces. Two rows need a closer look, the collection path and page 2, and they are the next two sections.

## Collection paths: served with a canonical, or redirected

A product can be reached under any collection: `/collections/summer/products/linen-tee` as well as `/products/linen-tee`. Themes used to link products that way, through the `within: collection` filter, which is where most Shopify duplicate-content warnings came from.

**Figure:**
src: /media/blog/shopify-canonical-tag/collection-paths.webp
alt: Diagram of a request for a product under a collection path and its two outcomes on 45 stores. Under /collections/all/: 22 stores served the product with a 200 and a canonical naming /products/linen-tee, 23 answered with a 301 or 302 redirect to /products/linen-tee. Under a named collection: 16 served it with a canonical to /products/, 29 answered 301 to /products/. Either way Google is sent to one URL
label: Collection paths
caption: Both outcomes end at the /products/ URL. A redirect also stops the copy being crawled at all.
aspect: 1400/441

None of the 45 served a collection-path product that named itself, so this is handled whichever way a store goes. What is left to check is your own theme's links: if product cards still link through the collection path, every collection link points at a URL you do not want indexed. The [duplicate content](https://crawlcove.com/blog/shopify-duplicate-content) post shows the one filter to remove.

## Page 2 and the three stores that point it at page 1

Shopify's `canonical_url` keeps the page number, so `/collections/tees?page=2` names itself. That is what Google wants for a paginated series: each page lists different products, and a canonical to page 1 would tell Google to ignore the products found on page 2 onwards.

42 of the 45 stores did that. The other three pointed page 2 at page 1. We fetched both pages on those three and they listed the same products, because the themes load the rest of the collection with a "Load more" button or infinite scroll and ignore `?page=`. So their canonical matches what the URL serves. The question it raises is a different one: can a crawler reach the products past the first screen? If they are only linked from content a script loads, make sure they are linked from somewhere else, such as the sitemap and other collections.

## When to override the default

Shopify's default is right for variants, collection paths, tracking links, sorted collections and pagination, so leave those alone. An override is for a page that is a real duplicate of a page Shopify cannot know about.

**Figure:**
src: /media/blog/shopify-canonical-tag/when-to-override.webp
alt: Two lists. Leave the default: variant links, collection paths, tracking and sort parameters, page 2 and beyond, a product that only looks similar to another. Override it: the same product sold on a second store of yours, a product listed twice where one listing has to stay, a page or article published on another site first, an old landing page kept live for a campaign
label: When to override
inline: html
caption: If two products differ in anything a shopper would choose between, they are two products. Give each its own description instead.
aspect: 1400/600

## How to set a custom canonical URL with a metafield

Shopify has no canonical field in the product editor. The method Shopify's own SEO team documents uses a metafield: you add a URL field to the page type, fill it on the pages you want to change, and edit one line of the theme to print it.

**Figure:**
src: /media/blog/shopify-canonical-tag/metafield-steps.webp
alt: Four steps. One: in Settings, Metafields and metaobjects, choose Products and add a definition named Canonical URL, namespace and key custom.canonical_url, type URL. Two: repeat for Collections, Pages or Blog posts if you need them. Three: in the product editor, fill the new field on the products to change. Four: in theme.liquid, replace the canonical line with Liquid that prints the field when it is filled and canonical_url when it is not
label: Four steps
inline: html
caption: Pages without the field filled keep Shopify's default, so the edit changes nothing until you use it.
aspect: 1400/372

Replace the canonical line in `theme.liquid` (on a duplicate of the theme first) with this:

```liquid
{%- liquid
  assign custom_canonical = nil
  case template.name
    when 'product'
      assign custom_canonical = product.metafields.custom.canonical_url.value
    when 'collection'
      assign custom_canonical = collection.metafields.custom.canonical_url.value
    when 'page'
      assign custom_canonical = page.metafields.custom.canonical_url.value
    when 'article'
      assign custom_canonical = article.metafields.custom.canonical_url.value
  endcase
-%}
<link rel="canonical" href="{{ custom_canonical | default: canonical_url }}">
```

It checks the template rather than whether a `product` or `collection` object exists, because on a product reached through a collection path both exist. Shopify's version of the snippet gets the same result by checking `product` first. Use a full `https://` URL in the field, and before you save it, check that the URL answers 200, is not noindexed and does not redirect. Then publish the theme and view the source of one changed product and one unchanged one.

## The faults we found

The 45 stores were clean on the basics. No missing tags, no relative URLs, no canonicals naming the `myshopify.com` address and no HTTP header canonicals. These were the only faults:

**Figure:**
src: /media/blog/shopify-canonical-tag/faults.webp
alt: Three cards. Two identical canonical tags on every page type, one store of 45: harmless today, but the first one is read, and the two will disagree the day one is edited. Page 2 named page 1, three stores: correct for what those pages serve, because the theme ignores ?page=, but products past the first screen depend on script for their links. hreflang listing a market URL that redirects, one store of the twelve with hreflang on products: its /en-us/ alternate answered 302 to the default product, so the pair cannot be confirmed
label: Faults
inline: html
caption: All three come from theme code or a Markets setting, which is why a theme or app change is the time to recheck.
aspect: 1400/419

## Canonical tags and Shopify Markets

Twelve of the 45 product pages carried hreflang tags. Five of those stores sell into other markets from subfolders such as `/fr/`, `/sv-se/` or `/en-ca/`, and on all five the market's product URL named itself as canonical and listed itself in its hreflang set. That is the right pattern: a translated or localised page is its own page, and the hreflang tags join the set. Three stores used separate country domains for their markets instead.

**Figure:**
src: /media/blog/shopify-canonical-tag/markets.webp
alt: Diagram of a product in two Shopify Markets. The default URL /products/linen-tee has a canonical to itself, and the market URL /fr/products/linen-tee has a canonical to itself. Both carry the same hreflang set naming both URLs plus x-default. A third box shows the fault: an hreflang alternate /en-us/products/linen-tee that answers 302 back to the default URL
label: Markets
caption: Never point a market URL's canonical at the default-language page. Google would drop the market page and its hreflang with it.
aspect: 1400/411

The one fault here was hreflang, not the canonical: a store listed an `/en-us/` alternate that answered with a 302 back to the default product, which usually means a market is set up in the hreflang but redirects visitors. The [Shopify hreflang](https://crawlcove.com/blog/shopify-hreflang) post covers Markets in full.

## How to check every canonical on a Shopify store

For one URL, view the source and search for `canonical`, or paste it into the free [canonical checker](https://crawlcove.com/tools/canonical-checker), which also follows the target to see whether it can be indexed. For the whole store, crawl it, because a theme or app fault lands on one page type, and you will not guess which.

In [Crawl Cove](https://crawlcove.com/ecommerce-seo-crawler), an indexable page with no canonical is a medium canonical finding. A canonical that names a page which redirects is a [canonical to redirect](https://crawlcove.com/issues/meta/canonical-to-redirect) finding, which is what a custom canonical typed with an old URL becomes. One that names a noindexed or erroring page is a [canonical to noindex](https://crawlcove.com/issues/meta/canonical-to-noindex) finding. An `http://` canonical on an https page is an [insecure canonical](https://crawlcove.com/issues/meta/insecure-canonical) finding, and two canonical tags on one page are a low multiple-canonical finding. Pages that canonicalise elsewhere are left out of the duplicate title, description and near-duplicate checks, so variant and collection-path copies do not fill those lists. Crawl Cove recognises a Shopify store from what its pages already contain and slows down when the store answers 429, so a full crawl finishes rather than stopping at the rate limit. The [canonical tag template bugs](https://crawlcove.com/blog/canonical-tag-template-bugs) post covers the faults a theme can bake into every page at once.

## FAQ

### Does Shopify add canonical tags automatically?
Yes. Shopify's own themes print a canonical tag on every page with the canonical_url Liquid object, and most third-party themes do the same. On the 45 stores we checked, every page type we requested had one.

### How do I add a canonical tag in Shopify?
Usually you do not need to. Open Online Store, Themes, Edit code, and search layout/theme.liquid for canonical. If you find a link tag that uses canonical_url, the store already has one. If a theme lacks it, add that one line inside the head.

### How do I change the canonical URL of one Shopify product?
Create a product metafield of type URL in Settings, Metafields and metaobjects, enter the URL you want on that product, then change the canonical line in theme.liquid so it prints the metafield when it is filled and canonical_url when it is not.

### Should Shopify variant URLs have their own canonical?
No. A ?variant= link shows the same product with one option selected, so its canonical should name the clean /products/ URL, which is what all 45 stores we checked did.

### Should page 2 of a Shopify collection canonicalise to page 1?
No, if page 2 lists different products. Shopify's default names page 2 itself, which lets Google find the products on it. The three stores we saw pointing page 2 at page 1 served the same products on both, because their themes load the rest with a button.

### Can a Shopify canonical tag point at another domain?
Yes. Google accepts a canonical on another domain, which is how you would point a product on a second store at the same product on your main store. Name a URL that answers 200 and is not noindexed.
