A canonical tag is a line of HTML that tells search engines which URL is the main version of a page when the same or very similar content can be reached at more than one address. It looks like <link rel="canonical" href="https://www.example.com/page/"> and sits in the page’s <head>. Search engines use it to decide which URL to index and show, and to combine the signals (links, relevance) that would otherwise be split between duplicates.
Canonical tags are simple to add and easy to get wrong. This guide covers how they work according to Google’s own documentation, the code, when to use a canonical instead of a redirect or noindex, the mistakes that make Google ignore them, and how to check which canonical Google actually chose.
The short version
- Use canonical tags to name the main URL when duplicates need to stay reachable.
- It’s a strong signal, not a command. Google weighs it with redirects, internal links and sitemaps.
- Add a self-referencing canonical to every indexable page.
- Use absolute URLs, in the
<head>, one canonical per page. - Point to a page that works: indexable, returning 200, not redirected.
- Redirect instead when the duplicate doesn’t need to exist for visitors.
- Don’t use robots.txt or noindex for canonicalization.
- Check URL Inspection to see the canonical Google selected.
Why duplicate URLs happen
Most sites have duplicate URLs without anyone creating them on purpose:
- Protocol and host:
http://andhttps://, with and withoutwww. - Trailing slashes and capitalization:
/pageand/page/,/Page/and/page/. - Parameters: tracking tags (
?utm_source=…), sorting and filtering (?sort=price), session IDs. - Multiple paths to one product:
/shoes/running/trail-x/and/sale/trail-x/. - Print or mobile versions: separate URLs for the same content.
- Syndicated content: your article republished on another site.
Google’s explanation of URL canonicalization describes how it groups duplicates into a cluster and picks one URL as canonical to show in results. Your job is to help it pick the right one.
How to add a canonical tag
In the HTML head
<head>
<link rel="canonical" href="https://www.example.com/running-shoes/" />
</head>
Put it on every version of the page, including the canonical page itself, pointing to the main URL.
In the HTTP header (for PDFs and other files)
For non-HTML files, such as a PDF available at two URLs, send the canonical as an HTTP header:
Link: <https://www.example.com/guides/boiler-guide.pdf>; rel="canonical"
Google’s guide to specifying a canonical notes the header method works for web search, and recommends choosing either the HTML element or the header rather than both, since using both is more error-prone.
Through your CMS
Most platforms add canonical tags automatically. WordPress SEO plugins, Shopify themes and site builders usually output a self-referencing canonical on each page. Check that it’s present, that it uses your preferred version of the URL (https, www or not, trailing slash or not), and that filtered or paginated pages handle it the way you intend.
How strong are canonical signals?
Google lists the methods that influence canonicalization:
| Method | Strength, per Google | Use it when |
|---|---|---|
| Redirect (301 or 308) | Strong signal that the target should be canonical | The duplicate doesn’t need to stay live |
| rel=“canonical” (HTML or header) | Strong signal | Duplicates must stay reachable |
| Inclusion in a sitemap | Weak signal | Supporting the other methods; list only canonical URLs |
The methods stack: using a canonical tag, linking internally to the canonical URL and listing only canonical URLs in your sitemap all point the same way, which makes Google far more likely to respect your choice. If you specify nothing, Google picks the version it judges best.
Canonical tag, redirect or noindex?
| Situation | Best choice | Why |
|---|---|---|
| Old URL after a move or redesign | 301 redirect | Visitors and crawlers should land on the new URL |
| http vs https, www vs non-www | 301 redirect, site-wide | Only one version should exist |
| Sorting and filter parameters on a product list | Canonical to the unfiltered list (unless the filtered page targets its own search) | Visitors still need the filters |
| Tracking parameters | Self-referencing canonical on the clean URL | The parameterized URLs must keep working |
| Same product in two categories | Canonical to one main product URL | Both paths stay usable |
| Printer-friendly version | Canonical to the main page | The print version is still useful |
| Syndicated article on another site | Cross-domain canonical to your original | Credits the original source |
| Thin page you don’t want in search at all | noindex | It isn’t a duplicate; it just shouldn’t be indexed |
Google is explicit that noindex isn’t the right tool for choosing a canonical within a site, because it blocks the page from Search entirely, and that robots.txt shouldn’t be used for canonicalization either: a URL blocked in robots.txt can still be indexed without its content.
Canonical tag best practices
From Google’s documentation, plus what we see on real sites:
- Use absolute URLs.
https://www.example.com/page/, not/page/. Relative canonicals are supported but cause problems, such as a test site that canonicalizes to itself. - Put it in the
<head>. Google only accepts the link element there. Watch for HTML errors or scripts that push it into the body. - One canonical per page. Plugins and themes sometimes both add one. Two conflicting tags cancel each other’s usefulness.
- Point to a working, indexable page. The canonical target should return 200, not redirect, not be blocked by robots.txt and not carry noindex.
- Match your internal links and sitemap. Link to canonical URLs everywhere, and list only canonical URLs in your XML sitemap.
- Keep the content genuinely equivalent. A canonical between pages with substantially different content is likely to be ignored.
- Set it in the source HTML. If your site renders with JavaScript, include the canonical in the initial HTML where possible, and make sure scripts don’t change it.
- Don’t canonicalize paginated pages to page one. Page two of a category has different products; give each paginated page a self-referencing canonical. Our pagination guide covers this in detail.
- Use hreflang, not canonicals, for language versions. Each language version should usually canonicalize to itself and list its alternates with hreflang.
Common canonical tag mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Every page canonicalizes to the homepage | Google ignores the tags or drops pages | Self-referencing canonicals on each page |
| Canonical points to a redirecting or 404 URL | Mixed signals; Google picks its own | Point to the final, working URL |
| Canonical uses http on an https site | Signals split between versions | Use your preferred protocol and host everywhere |
| Two canonical tags on one page | Both may be ignored | Remove the duplicate source (theme or plugin) |
| Paginated pages canonicalize to page one | Products on later pages may not be found | Self-referencing canonical per page |
| Canonical plus noindex on the same page | Conflicting instructions | Choose one: consolidate or exclude |
| Filtered pages you want ranked canonicalize away | They can’t rank for their own searches | Self-canonical on filter pages worth indexing |
| Sitemap lists non-canonical URLs | Weak signal pointing the wrong way | Sitemap lists canonical URLs only |
How to check canonical tags
See what you declared
View the page source and search for rel="canonical", or use a crawler to list the canonical of every URL on your site. Look for missing tags, duplicates, relative URLs and canonicals pointing to redirects or errors.
See what Google chose
In Search Console, inspect a URL with the URL Inspection tool. In the page indexing details, compare the user-declared canonical with the Google-selected canonical. If they differ, Google found stronger signals pointing elsewhere. Our guide to the URL Inspection tool explains every field.
The Page indexing report also groups affected URLs under statuses such as “Duplicate, Google chose different canonical than user” and “Duplicate without user-selected canonical”, which are good places to start an audit. Google’s canonicalization troubleshooting guide covers the common causes.
Cross-domain canonicals and syndicated content
If another site republishes your article, the best outcome is that search engines treat your page as the original. Ask the publisher to add a canonical tag on their copy pointing to your URL. Cross-domain canonicals are supported, but they’re only respected when the two pages are essentially the same content. If a partner won’t add one, a clear link back to your original near the top of their copy is the next best signal.
The same applies in reverse: if you republish someone else’s content, a canonical to their original is the honest and safe choice.
A five-minute canonical check
For any page that isn’t ranking as you’d expect:
- View source: is there exactly one
rel="canonical", in the<head>, with an absolute URL? - Does it point to the page itself (or the intended main version)?
- Does the canonical URL return a 200 status, without redirecting?
- Is the canonical URL allowed in robots.txt and free of noindex?
- Do internal links and the sitemap use the same URL?
- In URL Inspection, does the Google-selected canonical match the user-declared one?
If all six pass and Google still chooses another URL, compare the two pages’ content: Google may not consider them duplicates, or may consider the other one the better page.
Canonical tags on e-commerce sites
Shops generate the most duplicates: variants, filters, sorting, sale categories and tracking parameters. A sensible default:
- Products: one canonical URL per product, used in all category links. Variants that differ only by color or size usually canonicalize to the main product, unless each variant is searched for separately and deserves its own page.
- Category filters: filter combinations that match real searches (such as “women’s waterproof hiking boots”) get their own indexable page with a self-referencing canonical; arbitrary combinations canonicalize to the parent category.
- Sorting and view options: canonical to the default view.
Our e-commerce SEO guide covers filters and faceted navigation in more depth.
Get canonicals right across your site
Canonical problems rarely show up as a single error; they show up as pages that never quite rank, or the wrong URL appearing in results. A crawl plus URL Inspection on your key pages usually reveals them in an hour. If you’d like it done for you, our technical SEO team audits canonicals, redirects, sitemaps and internal links together, because they only work when they all agree.
