Canonical Tags: How to Handle Duplicate URLs
Yuuuk94·Published
Summary
A canonical tag tells search engines "the preferred URL for this page is this one". It is one line in <head>: <link rel="canonical" href="full URL">.
More sites have duplicate URLs than you would think. http vs https, www vs non-www, a trailing slash, or a tracking parameter all make a different URL to Google. Canonical is the easiest way to say which one to index.
01Where duplicate URLs come from
To a person these are the same page, but different URL strings are different pages to a search engine. On most sites, all of the following show the same content.
https://example.com/shoes
https://www.example.com/shoes
http://example.com/shoes
https://example.com/shoes/
https://example.com/shoes?utm_source=newsletter
https://example.com/shoes?sort=priceWhen Google finds a cluster like this, it picks one as canonical, shows it in results and hides the rest. The risks are that it picks a URL you didn't want, and that links and signals get split across several URLs.
02How to use it
<link rel="canonical" href="https://example.com/shoes" />- Use absolute URLs: a relative
/shoesworks, but writing outhttps://and the domain removes any chance of misinterpretation. - Point to yourself: even pages with no duplicates benefit from a self-referencing canonical, so a version shared with parameters still resolves cleanly.
- One per page: with two or more canonicals Google may ignore them all. Check for themes and plugins each adding their own.
- Inside `<head>`: a canonical in
<body>is ignored.
03Redirect or canonical?
| Method | Strength | When to use it |
|---|---|---|
| 301 redirect | Strong | The old URL is no longer needed (http→https, www unification, moved pages) |
| rel=canonical | Medium | Both URLs must stay available to users (sort/filter parameters, print versions) |
| Only canonical URLs in the sitemap | Weak | As a supporting signal alongside the others |
For http/https or www variants, users have no reason to stay on the old URL, so a redirect is the right answer: people and crawlers converge on one address. For a product list that differs only by sort order, users need the URL, so you can't redirect; declare the canonical instead.
04Common mistakes
Every page points to the home page
Put a single canonical in a shared layout and every page declares the same URL as canonical. Google then treats every other page as a duplicate of home and doesn't index them. Canonicals must be computed per page.
A development domain slips in
If the site URL comes from an environment variable, production can end up with a staging domain or localhost in the canonical. Right after deploying, search the page source for canonical and confirm it is the production domain.
Canonical combined with noindex
"Another URL is preferred" (canonical) and "don't index this page" (noindex) say different things. Together they send mixed signals. Use canonical to consolidate duplicates and noindex to remove a page; pick one.
Translations pointing to one language
If the English page's canonical points to the Korean page, the English page drops out of the index. Each language version should be canonical to itself, with hreflang describing the relationship. See hreflang setup.
05See which URL Google chose
Search Console's URL Inspection shows "User-declared canonical" and "Google-selected canonical" side by side. If they differ, Google didn't accept your canonical.
- Do internal links point to a different URL than the canonical (for example, with a trailing slash)?
- Does the sitemap list non-canonical URLs?
- Is the canonical target a 404, a redirect, or noindex?
- Are the two pages actually near-identical? Google may ignore a canonical between very different pages.
META_SCAN's Indexing card checks whether a page has a canonical set. Which URL Google actually selected is only visible in Search Console, so check both.
FAQ
- Q. Is there a penalty for not having a canonical?
- No direct penalty; Google chooses one itself. But it may choose a URL you didn't want, or split signals, so a self-referencing canonical is recommended.
- Q. Can a canonical point to another domain?
- Yes. When the same article is syndicated to other sites, pointing the canonical at the original is common. Confirm the publisher actually includes it.
- Q. Should paginated lists all point to page 1?
- No. Pages 2 and 3 have different content, so each is canonical to itself. Pointing them all to page 1 makes the items deeper in the list harder to discover.
Related reading
References
How does your site do?
Enter one URL to run the free SEO/AEO/GEO checklist, including everything covered in this post.
Check for free