A canonical tag is a line of code that tells search engines which version of a page is the main one. It matters because the same content can often be reached at more than one address, and when search engines find several copies they have to decide which to show. The tag removes the guesswork, or at least gives a strong hint.
Why duplicate URLs happen
Most duplication is accidental and created by the website itself, not by anyone copying content. Common causes:
- The site loading at both the www and non-www version of the domain, or over both http and https.
- The same page with and without a trailing slash.
- Tracking parameters added to links in emails and adverts.
- Sorting and filtering options on shop category pages, each creating a new URL.
- A product that appears in several categories, with a different address in each.
- Printer friendly versions and session IDs on older platforms.
To a visitor these are all the same page. To a search engine they are separate addresses with identical content, which splits signals such as links between them and wastes crawling on pages that add nothing.
What the canonical tag does
It sits in the head of the page and names the preferred address. Every duplicate carries a tag naming the main version, and the main version carries one naming itself. That self-referencing canonical is good practice on every page, because it protects against parameters and variations you have not anticipated.
Search engines then consolidate the duplicates, show the preferred address in results, and credit it with the signals the copies would otherwise have split.
A hint, not an instruction
This is the part that surprises people. Google treats a canonical tag as a strong signal rather than a command. If other signals disagree, such as internal links pointing to a different version, a sitemap listing another address, or redirects going elsewhere, Google may choose its own canonical instead.
You can see what Google has decided in Search Console. The URL Inspection tool shows both the canonical you declared and the one Google selected. When they differ, the cause is almost always mixed signals somewhere on the site.
The fix is consistency. Internal links, the sitemap, redirects and canonical tags should all point to the same version of every page.
Canonical tag or redirect
They solve related problems in different ways. A 301 redirect sends visitors and search engines to the new address automatically, and the old one effectively stops existing. A canonical leaves both addresses working and only tells search engines which one to index.
Use a redirect when the old address should not be used at all, such as after moving a page or settling on www or non-www. Use a canonical when both versions need to work for visitors, such as a filtered product list or a tracking link. Our guide to 301 redirects covers the redirect side in detail.
Common mistakes
Pointing every page at the homepage. This tells search engines all your pages are duplicates of one, and they may stop indexing the rest.
Combining a canonical with noindex. One says index this other version, the other says do not index this page at all. The signals conflict, so pick one.
Canonicalising paginated pages to page one. Page two of a category lists different products from page one, so it is not a duplicate. Each page in a series should normally point to itself.
Pointing at a broken or redirected address. The canonical should be the final, working URL that returns a normal page.
More than one tag on a page. Themes and plugins sometimes each add their own. When two disagree, search engines may ignore both.
Where to start
Most modern platforms add self-referencing canonicals by default, so the work is usually checking rather than writing. Inspect a few key pages in Search Console, look for any where the selected canonical differs from yours, and trace back the mixed signal. A crawl of the whole site will show duplicates, missing tags and tags pointing at broken pages.
It belongs with the other technical SEO foundations, and it is one of the first things our SEO service checks when pages refuse to index or the wrong version keeps appearing in results.