Skip to content

What Is a Canonical Tag?

Definition

A canonical tag is an HTML link element, rel="canonical", in a page's head that tells search engines which URL is the preferred version when the same content is available at several URLs. Google treats the canonical tag as a strong hint, not a rule, and uses it to choose the URL it shows and to consolidate ranking signals.

How a canonical tag works

The same content often lives at several URLs: with and without tracking parameters, sorted differently, or reached through different paths. Google groups those duplicates and picks one representative URL, the canonical, to show in search. This process is called canonicalization[1]. A canonical tag is how you tell Google which URL you prefer. It is a line in the page's <head>:

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

Google accepts the element only in the head section and recommends absolute URLs rather than relative ones. The canonical page should also point to itself, and internal links should use the canonical URL rather than a duplicate[2].

The canonical tag is a hint, not a rule. Google weighs it with other signals, such as HTTPS, redirects and sitemap inclusion, and may choose a different canonical than you specify[1]. Duplicate content on a site is normal and is not a spam policy violation[1]. The canonical tag decides which version appears in results and where ranking signals are consolidated.

Ways to signal the canonical URL

Google lists the methods in order of how strongly they influence canonicalization[2]:

MethodStrengthWhen to use it
301 redirectStrongThe duplicate URL should not exist for visitors at all
rel="canonical" link elementStrongThe duplicate must stay reachable, for example a sorted or filtered view
rel="canonical" HTTP headerStrong (alternative to the link element)When you cannot edit the HTML head; use one or the other, not both
Sitemap inclusionWeakAlways, but only list canonical URLs

The methods stack, so a self-referencing canonical, a sitemap that lists only canonical URLs and internal links that use them all point the same way. Google also advises against using robots.txt or noindex for canonicalization within a site, and against declaring different canonicals for the same page through different methods[2].

Canonical tags on Shopify

Shopify adds canonical tags automatically to prevent duplicate content in search results[3]. In Shopify's Dawn theme, the layout file outputs it with one line of Liquid[4]:

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

The canonical_url object returns the canonical URL for the current page[5]. That matters because Shopify creates duplicates by design. A product inside a collection can be opened at /collections/sale/products/linen-shirt as well as /products/linen-shirt, and Shopify's own documentation notes that these are the same content on separate URLs[6].

Pagination is the one place where pointing every page to a single URL is wrong. Google says not to use the first page of a paginated sequence as the canonical and to give each page its own canonical URL[7]. We cover the details, including the theme code that breaks it, in our guide to canonical pagination on Shopify.

Example: one product, nine URLs

Take a hypothetical store with a linen shirt in 4 colours, listed in 3 collections (Men, Summer and Sale). Without any effort, the shirt is reachable at:

  • 1 product URL: /products/linen-shirt
  • 3 collection-scoped URLs: /collections/men/products/linen-shirt and the same for Summer and Sale
  • 4 variant URLs: /products/linen-shirt?variant=…, one per colour
  • 1 campaign URL: /products/linen-shirt?utm_source=newsletter

That is nine URLs for one page, and a catalogue of 500 products multiplies it to thousands. All nine should declare /products/linen-shirt as the canonical. Then Google consolidates links, shares and ranking signals onto one URL, and crawlers spend less time on copies[2]. To check your own store, open a collection-scoped product URL, view the source and search for rel="canonical". If it shows the collection path, the theme or an SEO app has overridden the default.

The collection pages behave differently. /collections/sale?page=2 lists different products from page 1, so it keeps its own canonical, as Google recommends for paginated pages[7].

Canonical tag vs 301 redirect vs noindex

Canonical tag301 redirectNoindex
Visitors can still open the URLYesNo, they are sent to the targetYes
What it tells GooglePrefer this other URLThis URL has movedDo not show this URL in search
Binding?A hint Google may overrideA strong signalA directive for that URL
Use it forVariants, parameters, collection pathsDeleted or moved pagesPages that should not be in search at all

FAQ

Does Shopify add canonical tags automatically?

Yes. Shopify adds auto-generated canonical tags to pages to prevent duplicate content in search results[3]. Themes output them through the canonical_url Liquid object, so a typical store has nothing to configure.

Does Google always follow the canonical tag?

No. A canonical tag is a hint, not a rule. Google also looks at redirects, HTTPS, sitemaps and internal links, and may pick a different URL[1]. Consistent signals make it far more likely Google picks yours.

Should a page have a canonical tag pointing to itself?

Yes. Google recommends a rel="canonical" link on the canonical page itself[2]. A self-referencing canonical protects the page when someone links to it with parameters you did not plan for.

Should I use canonical or noindex for duplicate pages?

Canonical. Google advises against using noindex to choose a canonical within a site[2]. Noindex removes a page from search, while a canonical consolidates its signals onto the preferred URL.

How do I change the canonical URL on Shopify?

Edit the theme code where the tag is output, usually theme.liquid or a meta tags snippet[4]. Change it only for a clear reason, because the default is correct for most pages.

The bottom line

A canonical tag names the preferred URL when the same content exists at several addresses. Google treats it as a strong hint, not a command. Shopify outputs it automatically and gets it right for most pages, so the job is mainly to avoid breaking it with apps, theme edits or pagination shortcuts. If you want us to check yours, our Shopify SEO audits start with canonicals, redirects and indexing.

Article sources

We use primary sources only: official documentation, product pages and laws. Each link was checked on the date shown.

  1. Google Search Central. What is URL canonicalization. Accessed 17th Nov 2026.
  2. Google Search Central. How to specify a canonical URL with rel="canonical" and other methods. Accessed 17th Nov 2026.
  3. Shopify Help Center. SEO overview. Accessed 17th Nov 2026.
  4. Shopify (GitHub). Dawn theme: layout/theme.liquid. Accessed 17th Nov 2026.
  5. Shopify. Liquid objects: canonical_url. Accessed 17th Nov 2026.
  6. Shopify. Liquid filters: within. Accessed 17th Nov 2026.
  7. Google Search Central. Pagination, incremental page loading, and their impact on Google Search. Accessed 17th Nov 2026.
  8. Shopify Help Center. SEO for Shopify Markets. Accessed 17th Nov 2026.

Need this on your store?

See the service

The checklist we run before touching a client's code

Get it by email, plus a few short notes over the next two weeks: what we see most often on Shopify stores and what actually fixes it.

No spam. Unsubscribe anytime. Privacy Policy