What Are Canonical Tags and How to Use Them
A canonical tag tells search engines which URL is the master version of duplicate pages. How rel=canonical works, where it goes, and the mistakes to avoid.
A canonical tag — written as rel="canonical" — tells search engines which URL is the preferred, master version of a page when duplicate or near-duplicate versions exist at different addresses. Its job is to consolidate ranking signals onto one URL and prevent duplicate content from splitting those signals across copies. It lives in the page's <head> (or in an HTTP header for non-HTML files), it should point to an absolute, live, indexable URL, and — importantly — Google treats it as a strong hint, not an absolute directive. This guide explains how canonical tags work, where they go, how Google interprets them, and the mistakes that quietly wreck indexing.
It is a core piece of technical SEO that sits alongside how to write a title tag and meta description and your indexing setup.
The problem canonical tags solve
The same content is often reachable at more than one URL without anyone intending it. A product page might be available at /shoes, /shoes?color=red, /shoes?ref=newsletter and /shoes?sessionid=123. A site might serve both http:// and https://, or both www. and the bare domain. A blog post might have a "print" version. To a search engine, these can look like separate pages with duplicate content.
That creates two problems. First, signal dilution: links, relevance and authority that should accrue to one page get split across several near-identical URLs, weakening all of them. Second, wasted crawling and indexing confusion: the engine spends effort on duplicates and may pick a version to show that you did not intend. The canonical tag solves both by naming the one URL that should represent the set — the canonical — so engines consolidate signals there and treat the rest as copies of it.
How rel="canonical" works
A canonical tag is a single line in the HTML head:
<link rel="canonical" href="https://example.com/shoes" />
Placed on every variant of the shoes page, it tells search engines: "whatever URL you arrived at, the master version is https://example.com/shoes — attribute the signals there." The engine can then consolidate the duplicates onto the canonical and generally index and show that preferred URL.
Three details make a canonical correct:
- Use an absolute URL, not a relative path.
https://example.com/shoes, not/shoes. - Point to a live, indexable, 200-status URL — not a page that redirects, returns 404, or is itself blocked from indexing.
- Be consistent about the format you canonicalise to (https, trailing slash or not, www or not), so you are not sending mixed signals across the site.
Self-referencing canonicals
The cleanest default is to give every indexable page a self-referencing canonical — a canonical that points to the page's own URL. On https://example.com/shoes, the canonical is https://example.com/shoes. This sounds redundant, but it removes ambiguity: it explicitly declares "this is the master version," which matters the moment a tracking parameter or a variation creates an alternative URL. With self-referencing canonicals in place, …/shoes?ref=twitter still carries a canonical pointing to the clean …/shoes, and the signals consolidate correctly. Most SEO guidance recommends self-referencing canonicals as standard hygiene for exactly this reason.
Where the canonical goes
There are two valid places to declare a canonical.
In the HTML <head> is the common case, as the <link rel="canonical"> element shown above. It must be in the head, not the body — a canonical placed in the body is ignored.
In an HTTP header is the option for non-HTML files, such as PDFs, where there is no HTML head to put a tag in. The server sends a Link: header with rel="canonical", for example to point a downloadable PDF at its preferred URL. This is the right tool when you need to canonicalise something that is not an HTML page.
How Google treats the canonical: a hint, not a command
This is the most misunderstood part. Google treats rel="canonical" as a strong hint, not an absolute directive. When Google chooses the canonical for a set of duplicate pages, your declared canonical is one signal among several. Others include:
- Internal linking — which version your own site links to most.
- The XML sitemap — which URL you list there (see how to create an XML sitemap and submit it).
- Redirects — 301s point strongly at a preferred URL.
- HTTPS preference and which version Google judges best for users.
If these signals agree, Google almost always honours your canonical. If they conflict — say your canonical points to URL A but your sitemap lists URL B and your internal links go to URL C — Google may pick whichever it judges most appropriate, which might not be your stated choice. The practical lesson: a canonical is not a switch that forces Google's hand; it is a recommendation that works best when all your other signals point the same way.
Scenario-to-canonical reference
Here is how to handle the situations that come up most often.
| Scenario | Correct canonical |
|---|---|
URL with tracking parameters (?ref=, ?utm_) | Canonical to the clean, parameter-free URL |
| HTTP and HTTPS both resolve | Canonical (and redirect) to the HTTPS version |
| www and non-www both resolve | Canonical (and redirect) to your chosen host |
| Print or AMP-style alternate version | Canonical to the main HTML version |
| Near-duplicate product variants | Canonical variants to the main product URL (if truly equivalent) |
| Paginated series (page 2, 3…) | Self-reference each page; do not canonical all to page 1 |
| Syndicated content on another domain | The syndicating site canonicals to your original |
| A standalone, unique page | Self-referencing canonical to itself |
Note the pagination row: a common error is canonicalising every page of a paginated series to page one, which can hide the deeper pages' content from indexing. Each paginated page should usually self-reference, because page two is not a duplicate of page one — it has different content.
Common mistakes that break indexing
Canonical tags are simple to write and easy to get subtly wrong. These are the costly errors.
Canonicalizing to the wrong or non-existent URL
If your canonical points to a URL that is 404, redirected, blocked, or simply the wrong page, you are telling Google to consolidate signals onto something broken or unintended — which can deindex the real page or send its authority into a void. Templating errors are a frequent culprit: a misconfigured CMS that stamps every page with a canonical pointing to the homepage, for instance, can quietly tell Google that your entire site is "really" the homepage. Always verify that canonicals resolve to the right, live, indexable URL.
Conflicting signals: canonical vs noindex
Do not combine a canonical and a noindex on the same page. A canonical says "consolidate onto this URL, which I want indexed"; noindex says "do not index this page at all." Together they contradict each other, and Google's handling becomes unpredictable. Pick the right tool: canonical to merge duplicates you want represented by one URL; noindex to keep a page out of the index entirely. This relationship also touches your robots setup — see how to write a robots.txt file for what robots rules can and cannot do (note that robots.txt blocking is different again, and blocking a page can stop Google from even seeing its canonical).
Canonical vs sitemap disagreement
If your sitemap lists a URL that your canonicals point away from, you are sending mixed messages — listing a page as canonical-worthy in the sitemap while telling Google elsewhere it is a duplicate. Keep the sitemap and your canonicals consistent: list the canonical URLs, not the duplicates.
Mishandling parameters and faceted navigation
E-commerce faceted navigation (filters for colour, size, price) can generate enormous numbers of parameterised URLs. Canonicalising sensible filter combinations to a clean base URL helps, but it needs thought — some filtered views are genuinely useful and unique, others are pure duplicates. Decide which deserve to be indexed and canonical the rest to their base.
Cross-domain canonicals done carelessly
You can canonical across domains — useful when you syndicate your content to a partner site and want the original to get the credit (the partner canonicals to you). But doing it carelessly, or in the wrong direction, hands your ranking signals to another domain. Make sure the canonical points to the version that should own the authority — usually your original.
Relative URLs and head placement
A relative canonical (/shoes) can be misinterpreted; use absolute URLs. And a canonical placed outside the <head> is ignored entirely. Both are easy to verify and easy to miss.
How to check your canonical tags
Verifying canonicals is straightforward. View source (or use your browser's dev tools) on key pages and confirm the <link rel="canonical"> in the head points where you expect. Use Google Search Console's URL Inspection tool to see the "user-declared canonical" versus the "Google-selected canonical" — if they differ, Google has overridden your hint, which is a signal to investigate your conflicting signals. Crawl the site with an SEO crawler to find pages with missing, duplicate, broken, or homepage-pointing canonicals at scale. A broad site audit, StackOptic included, can surface canonical and indexing issues alongside the rest of your technical SEO so you see them in context.
A canonical-tag checklist
- Give every indexable page a self-referencing canonical by default.
- Use absolute, live, indexable (200-status) URLs.
- Place the canonical in the
<head>, or in an HTTP header for non-HTML files. - Keep canonicals, internal links, redirects and the sitemap consistent.
- Canonical parameter and tracking URLs to their clean version.
- Self-reference paginated pages; do not collapse them to page one.
- Never combine canonical and noindex on the same URL.
- For syndication, have the partner canonical to your original.
- Verify with Search Console's URL Inspection and an SEO crawler.
Where to start
If you are unsure of your current state, start by crawling the site and listing every page's declared canonical. Look first for the dangerous patterns: canonicals pointing to 404s or redirects, every page canonicalised to the homepage, pages with both a canonical and a noindex, and sitemaps that disagree with the canonicals. Fix those, because they actively harm indexing. Then add self-referencing canonicals anywhere they are missing, and make your format consistent (https, host, trailing slash). Finally, spot-check important pages in Search Console to confirm Google's selected canonical matches your intent. That sequence — fix the harmful conflicts, add self-references, verify in Search Console — resolves the vast majority of canonical problems.
Go deeper
- The on-page basics: how to write a title tag and meta description.
- Get pages discovered: how to create an XML sitemap and submit it.
- Help engines understand you: what is schema markup and which types you need.
- Control crawling: how to write a robots.txt file.
Want canonical and indexing issues flagged automatically? Analyse any URL with StackOptic — one report covering technical SEO, performance and more, free, no sign-up.
Frequently asked questions
What is a canonical tag?
A canonical tag is an HTML element, rel="canonical", that tells search engines which URL is the preferred or 'master' version of a page when duplicate or very similar versions exist at different URLs. It consolidates ranking signals onto the chosen URL and helps prevent duplicate content from splitting those signals. It is placed in the page's <head>, or delivered via an HTTP header for non-HTML files.
When should I use a canonical tag?
Use one whenever the same or very similar content is reachable at more than one URL — for example, URLs with tracking parameters, HTTP versus HTTPS, www versus non-www, print versions, or near-duplicate product variants. Point the canonical to the single version you want indexed. As a baseline, give every indexable page a self-referencing canonical that points to itself, so the preferred URL is always explicit.
Does Google always obey the canonical tag?
No. Google treats rel="canonical" as a strong hint, not an absolute directive. It considers your canonical alongside other signals — internal links, the sitemap, redirects and which version it judges best for users — and can select a different canonical if those signals conflict or your declared canonical looks wrong. Consistent, non-conflicting signals are how you make Google honour your choice.
What is a self-referencing canonical tag?
A self-referencing canonical is a canonical tag on a page that points to that same page's URL. It explicitly tells search engines 'this is the master version,' which removes ambiguity, especially when parameters or variations could create duplicate URLs. Most SEO guidance recommends a self-referencing canonical on every indexable page as a clean default that prevents accidental duplicate-content confusion.
What is the difference between canonical and noindex?
A canonical tag consolidates duplicate pages onto one preferred URL that you still want indexed; the duplicates pass their signals to the canonical. A noindex tag tells search engines not to index a page at all. They serve different goals and should not be combined on the same URL, because pointing a canonical at a page while also telling engines to drop it sends a contradictory signal that can produce unpredictable indexing.
Analyse any website with StackOptic
Get the full technology stack, performance, security and SEO report in seconds — free.
Analyse a websiteRelated articles
How to Optimize a Blog Post for SEO and AI Search (GEO)
One workflow that serves Google and AI engines at once: intent, answer-first intros, scannable structure, schema, E-E-A-T, cited stats and freshness.
How to Handle Pagination for SEO
Pagination done wrong hides content from Google. The modern best practice: self-referencing canonicals, crawlable links, and view-all vs paginated.
How to Improve Your Click-Through Rate in Search
Ranking is half the battle — people still have to click. How to lift search CTR with better titles, meta descriptions, rich results and intent matching.