• Shopware Gold Partner & Shopify Partner

Canonical tag

The canonical tag specifies which of several URLs with the same content is the main version. Google consolidates the signals on it and shows only that version in search results. It is a strong hint, not a directive, and indispensable for stores with filters, variants and parameters.
Canonical Tag

The canonical tag is an element in a page’s source code with which a website tells search engines which URL is the main version of a piece of content. It is needed when the same or almost the same content can be reached under several URLs. Google then consolidates the signals of all variants on the specified URL and shows only this one in the search results. For online stores it is indispensable, because filters, sorting, variants and tracking parameters constantly create new URLs for the same content.

What the canonical tag looks like

The canonical tag sits in the header section of a page, in the head element:

<link rel="canonical" href="https://www.your-store.com/metal-raised-beds">

The URL should always be given in full, with protocol and domain. For files without an HTML head, such as PDF data sheets, the same information can be sent as an HTTP header:

Link: <https://www.your-store.com/datasheet.pdf>; rel="canonical"

Google, Yahoo and Microsoft jointly introduced the canonical tag in 2009. Today all major search engines evaluate it.

A hint, not a directive

The most important point for understanding it: for Google, the canonical tag is a strong signal, but not an obligation. Google decides itself which URL it selects as canonical and takes further signals into account:

  • Redirects: a very strong signal.

  • The canonical tag: a strong signal.

  • Internal linking: which URL does the store itself link to?

  • The [XML sitemap](xs): which URL is listed there?

  • HTTPS and clean URLs: Google prefers these when in doubt.

If the signals contradict each other, for example because the canonical tag points to URL A but the navigation links to URL B, Google may choose a different version than intended. In Search Console, this appears as “Duplicate, Google chose different canonical than user”.

Self-referencing canonical

Even a page without duplicates should carry a canonical tag pointing to itself. This sounds superfluous, but it protects reliably: if someone opens the page with a parameter, for example from a newsletter with ?utm_source=newsletter, the variant automatically points to the clean URL.

Canonical, redirect or noindex?

Tool

What happens

When to use

canonical tag

both URLs remain reachable, signals are consolidated

variants, parameters, sorting, duplicate paths

301 redirect

the old URL disappears, visitors land on the new one

permanently moved or merged pages

noindex

the page remains reachable but not in the index

pages without search value, such as internal search results

robots.txt

the page isn’t crawled

areas that shouldn’t be accessed at all

If a URL is no longer needed, a redirect is almost always the better choice than a canonical tag. Blocking via robots.txt, on the other hand, isn’t suitable for duplicates: Google can’t fetch the blocked page and therefore doesn’t see its canonical tag either.

Typical use cases in an online store

  • Sorting and parameters: a category with ?order=price or ?utm_source= points to the URL without parameters.

  • Variants: sizes and colours of a product that have their own URL point to the main product if their content hardly differs. If variants have their own demand, such as a specific colour that is searched for, they can also be canonical pages in their own right.

  • Products in several categories: if a product can be reached via several category paths, the canonical tag defines one of them as the main URL.

  • Pagination: page 2 of a category points to itself, not to page 1. Otherwise Google treats the products on the following pages as duplicates and they are found less easily.

  • Several domains: if the same content appears on two domains, for example a manufacturer text in your own guide, a cross-domain canonical tag is possible.

  • Language versions: each language or country version points to itself. The connection between the versions is made by hreflang, not by the canonical tag.

Canonical tags in Shopware and Shopify

Shopware 6 sets canonical tags automatically. For products with variants, you can define in the product’s SEO section whether each variant points to itself or all point to a main variant. For products in several categories, the main category per sales channel determines which path becomes the canonical URL.

Shopify sets the canonical tag via the theme. Products opened via a collection, for example under /collections/women/products/sneaker, point to /products/sneaker. URLs with ?variant= point to the product. Problems mainly arise from themes or apps that change the canonical tag or add a second one.

More on the technical peculiarities under Shopware SEO and Shopify SEO.

Typical mistakes

  • Canonical pointing to a redirect, an error page or a noindex page: Google usually ignores the hint then.

  • Canonical and noindex on the same page: contradictory signals. Either the page should have a different main version or it shouldn’t be in the index at all.

  • Two canonical tags on one page: for example one from the theme and one from an app. Google then ignores both.

  • All pages point to the homepage: a template error that can take whole stores out of the index.

  • Wrong protocol or wrong domain: http instead of https, without www or the URL of a test system.

  • Canonical only via JavaScript: Google can detect it when rendering, but it is more reliable in the delivered source code.

How to check the canonical tag

  • In the source code: open the page source and search for rel="canonical". There must be exactly one.

  • In Google Search Console: URL inspection shows the “user-declared” and the “Google-selected” canonical URL. If they differ, something is wrong with the signals.

  • In the indexing report: messages about duplicates show where Google decides differently from the store. How to proceed there is described in the article on Google indexing.

What duplicates generally mean for ranking is explained in the entry on duplicate content.

Frequently asked questions

Does every page need a canonical tag?

It is recommended. A canonical tag pointing to its own URL never hurts and reliably catches parameters and variants.

Does Google always follow the canonical tag?

No. It is a strong signal, but Google can choose a different version if internal links, the sitemap or the content suggest otherwise.

Is a canonical tag the same as a redirect?

No. With a redirect, the old URL disappears for visitors. With a canonical tag, both URLs remain reachable; only the main version appears in the search results.

May a page point to another domain?

Yes. Cross-domain canonical tags are allowed, for example when the same text appears on two of your own websites.

Are filter pages with a canonical tag still crawled?

Yes. The canonical tag consolidates the signals but doesn’t save any crawling. With very many filter combinations, the robots.txt is the right additional tool.