Your shop sells a blue shirt. Customers can reach that same shirt through /shirts/blue-shirt/, /sale/blue-shirt/ and /shirts/blue-shirt/?color=blue&size=m. To you, it is one product. To Google, those are three different addresses showing almost the same page. Which one should appear in search? That is the question canonical tags answer, and it is one of the most misunderstood topics in technical SEO.
In this lesson, I will explain what a canonical URL is, how the rel="canonical" tag works, why Google sometimes ignores it, and how to set it up correctly. By the end, you will be able to check the canonical on any page and know whether it is helping or hurting you.
What is a canonical URL, in plain words?
When several URLs show the same or very similar content, Google groups them together and picks one to represent the group in search results. That chosen URL is the canonical. The others become duplicates or alternates. Google calls this process canonicalization.
A simple way to think of it: imagine the same photo saved in five folders on your computer. When a friend asks for “the photo,” you send one copy, the best one. You don’t send all five. Google does the same with duplicate pages. It shows one version and keeps the others in the background.
We already met duplicate pages in the lesson on duplicate content. Google lists several everyday causes in its documentation:
- Protocol and host variants, such as
http://vshttps://, or with and withoutwww. - Site functions, such as sorting and filtering options on a category page that add parameters to the URL.
- Device variants, such as a separate mobile site at
m.example.com. - Region variants, such as near-identical pages for the US and the UK in the same language.
- Accidental variants, such as a staging or demo copy of the site that crawlers can reach.
Here is the reassuring part. Google’s documentation says having some duplicate content is normal and not a violation of its spam policies. You won’t be “penalized” for having a print version of a page. But if you don’t guide Google, it may pick a version you don’t like, such as a URL full of tracking parameters, and your reports become harder to read.
How does the rel=canonical tag work?
The canonical tag is a small line of HTML that you put in the <head> of a page. It tells search engines, “The main version of this content lives at this address.” It looks like this:
<link rel="canonical" href="https://www.example.com/shirts/blue-shirt/">
In our shirt example, all three URLs would carry that same tag pointing to /shirts/blue-shirt/. The main page points to itself, and the other two point to it.
What is a self-referencing canonical?
A self-referencing canonical is a canonical tag on a page that points to that page’s own URL. Google recommends adding one to your canonical pages. It looks pointless at first, but it helps when someone links to your page with extra parameters, such as ?utm_source=newsletter. The tag tells Google the clean URL is the real one.
Most SEO plugins for WordPress, and platforms like Shopify, add self-referencing canonicals automatically. So for many small sites the job is to check them, not write them by hand.
The rules Google gives for the tag
- Put it in the
<head>. Google only accepts it there, not in the body. - Use the full, absolute URL, including
https://and the domain. Relative paths are not recommended. - Point to a page that works: it should return a 200 status, not a redirect, a 404 or a noindexed page.
- Use one canonical per page. Two conflicting tags confuse things.
- Don’t point to a URL with a
#fragment. - If JavaScript adds or changes the tag, make sure it doesn’t contradict the canonical in the original HTML. (We cover this more in JavaScript SEO basics.)
For PDFs and other non-HTML files, you can send the canonical as an HTTP Link header instead. Google notes this method is supported for web search results only. Most beginners will never need it.
Is a canonical tag a command or a suggestion?
It is a suggestion. Google describes canonical signals as a hint, not a rule. The tag is a strong hint, but Google looks at other signals too and then picks what it thinks is the most complete and useful version.
Here is how Google ranks the main ways you can show your preferred URL, from its documentation on consolidating duplicate URLs:
| Method | Strength of signal | Best used when |
|---|---|---|
| Permanent (301) redirect | Strong | You want to retire the duplicate URL completely, so visitors never see it. |
rel="canonical" link (HTML or HTTP header) | Strong | The duplicate must stay reachable for users, like a filtered or tracked URL. |
| Listing the URL in your sitemap | Weak | As a supporting signal: list only canonical URLs in your sitemap. |
The other signals Google weighs include whether a page uses HTTPS, which URLs your internal links point to, and how similar the pages really are. Google generally prefers HTTPS pages over HTTP ones when both exist. The point is that your signals should all agree. If your canonical tag says one URL, your sitemap lists another and your menu links to a third, you are sending mixed messages.
So the strongest setup is not “a canonical tag.” It is a canonical tag plus internal links, a sitemap and redirects that all point the same way. If you want to choose and enforce one version of your domain, my post on trailing slashes, www and HTTPS shows how.
Why did Google choose a different canonical than mine?
In Search Console, you may see the status “Duplicate, Google chose different canonical than user.” We met it in the indexing lesson. It means you named one URL, but Google picked another. The usual reasons are:
- The pages are not really duplicates. If you point a canonical from a page about red shoes to a page about blue shoes, Google may ignore it, because a duplicate must be similar to its canonical.
- Your signals conflict. Internal links, the sitemap or hreflang tags point to a different URL than the canonical tag does.
- The canonical target has problems. It redirects, returns an error, is blocked, or is on HTTP while the duplicate is on HTTPS.
- Another version is linked much more. If most links, inside and outside your site, point to a different version, Google may decide that one is the real main page.
To check, open the URL Inspection tool and compare “User-declared canonical” with “Google-selected canonical.” If they differ, fix the signals above and give Google time to recrawl. Sometimes Google’s choice is actually fine, for example when it picked the HTTPS version over an old HTTP canonical you forgot to update.
Which canonical mistakes cause the most trouble?
Instead of a long list of don’ts, here are the problems I most often see in audits, with what to do instead. Each one comes back to the same idea: say one thing, clearly, everywhere.
| Problem | Why it hurts | Better approach |
|---|---|---|
| Every page’s canonical points to the home page | Tells Google all pages are duplicates of the home page, so they may drop out. | Self-referencing canonicals on each unique page. |
| Paginated pages (page 2, 3…) all canonical to page 1 | Products or posts linked only from later pages may not be found or indexed. | Let each page in a series canonical to itself. See pagination and SEO. |
| Canonical points to a URL that redirects or returns 404 | Sends Google to a dead end, so it will likely pick its own canonical. | Point straight to the final, live URL. |
| Using robots.txt to block duplicates | Google can’t crawl the page, so it never sees the canonical, and the URL can still be indexed without content. | Allow crawling and use a canonical tag. |
| Using noindex instead of a canonical | Google advises against noindex for choosing a canonical within a site, because it removes the page entirely. | Use rel=canonical or a redirect. |
| Using the Removals tool on duplicates | It hides all versions of the URL from search, including the one you want. | Use canonicals or redirects. |
Filters on online shops deserve their own note, because they can create thousands of URL variations. My guide to faceted navigation SEO explains how to decide which filter pages deserve to be indexed and which should canonical back to the main category.
Try it: check the canonical on three of your pages
You don’t need any paid tools for this. Here is how I suggest you do it.
- Open one of your main pages in Chrome. Right-click and choose “View page source.”
- Press Ctrl+F (Cmd+F on Mac) and search for
canonical. - Check that there is exactly one canonical tag, that it is inside the head, that it uses the full
https://URL, and that it matches the URL you want in search. - Now add a test parameter to the address, for example
?test=1, reload, and view source again. The canonical should still show the clean URL without?test=1. - Paste the clean URL into Search Console’s URL Inspection tool. Compare the user-declared canonical with the Google-selected canonical.
- Repeat for a blog post and for a category or product page.
If all three pages pass, your setup is most likely sound. If you find canonicals pointing to the home page, to old HTTP URLs or to the wrong domain, fix them in your SEO plugin or theme settings, or ask your developer.
Questions beginners ask about canonical tags
Do I need a canonical tag on every page?
It isn’t required, but I recommend it. A self-referencing canonical on each indexable page is a simple, clear signal, and most CMS platforms add it for you.
Does a canonical tag pass link value like a redirect?
Google treats both as strong canonical signals and consolidates duplicates into the chosen URL. The practical difference is for users: a redirect sends people to the new URL, while a canonical leaves the duplicate page visible.
Can I point a canonical to a page on another domain?
Yes. This is common when you republish an article on another site and want the original to be treated as the main version. The two pages should be very similar for Google to respect it.
Should hreflang language versions canonical to the English page?
No. Each language version should canonical to itself and link to the others with hreflang. Google’s documentation says annotations with hreflang are not used for canonicalization. We cover this in international SEO and hreflang.
Canonical tags in a nutshell, and what comes next
In brief: a canonical URL is the main version Google shows when several URLs carry the same content. You suggest it with a rel="canonical" tag in the head, using a full URL, ideally self-referencing on every page. Google treats it as a strong hint, so back it up with matching internal links, sitemap entries and redirects. When Google disagrees, look for conflicting signals or pages that aren’t really duplicates.
Redirects came up several times here as the strongest way to merge duplicates. The next lesson, redirects: 301, 302 and when to use them, explains how they work. If you find a canonical mess on a large site and want a second pair of eyes, our SEO team can help; request a free quote anytime.