What is a canonical tag?
Short answer
A canonical tag is a line of code in a page that tells search engines which address is the main version when the same content can be reached at more than one address. Google treats it as a strong hint, not an order, and uses it to decide which version to show and to credit.
When the same content can be reached at more than one address, a canonical tag is the line of code in the web page that tells search engines which address is the main version. That happens often, and a search engine has to pick one address to store and show. The tag sits in the hidden top section of the page’s code and is written as a link marked rel=”canonical”. Visitors never see it.
How one page ends up at several addresses
It happens through ordinary website behavior, without anyone copying anything. The same page may load:
- with and without “www” at the front, or with “http” and “https”
- with and without a slash at the end of the address
- with tracking codes added to the end by an ad, an email or a social media link
- under two different sections of the site, when a service is filed in two categories
- as a separate print version
To a person these are one page. To a search engine each address is a different page until something says otherwise. A hypothetical electrician in Carlsbad with one page about panel upgrades might, from Google’s side, have that page at four or five addresses.
What the tag does
It names the address you want treated as the original. When Google accepts it, the duplicate addresses are folded into that one: Google shows the chosen address in results and counts links pointing at the other versions toward it. Without the tag, Google still picks one, and it may not pick the one you would.
A page whose canonical tag points to its own address is normal and useful. It confirms that this is the main version, whatever tracking codes get attached to the address later.
It’s a hint, and Google can overrule it
The tag counts strongly with Google, which still weighs it with other signals, such as which address your own pages link to, which one is in the sitemap, and where any redirects lead. If those disagree with the tag, Google may choose a different address.
You can see the outcome. The URL Inspection tool in Google Search Console shows the canonical address the page declared and the one Google selected. When the two differ on a page that matters, the cause is usually mixed signals somewhere on the site, and it’s worth tracing. I do that as part of indexing and crawling work.
Canonical tag, redirect or neither
Use a canonical tag when both addresses need to keep working for visitors. Use a redirect when one of them should stop being used.
| Situation | What to use |
|---|---|
| An old address has been replaced and nobody should land on it | A 301 redirect to the new address |
| The same page loads with tracking codes or as a print version | A canonical tag pointing to the clean address |
| Two different pages say much the same thing | Neither. Rewrite one so it earns its place, or merge them and redirect. |
| A page shouldn’t be in search results at all | A noindex instruction, not a canonical tag |
The third row is where the tag gets misused. It does nothing for thin or repeated writing, the kind of duplicate content that only rewriting or merging fixes.
Mistakes that do real damage
A wrong canonical tag can remove good pages from Google, because it tells Google to disregard the page it sits on. These are the ones to look for.
- Every page pointing to the homepage, usually from a theme or plugin setting. That tells Google only the homepage counts.
- Tags pointing to the test copy of the site, left over from before launch.
- Tags pointing to an address that redirects or no longer exists.
- City or service pages all pointing to one of the set. The others drop out of results, even though each was written to be found.
Most of these appear right after a redesign or a change of domain, which is why canonical tags are on my checklist for site migrations.