Why duplicate URLs happen
Almost no site has one URL per page by accident. The same product can answer at:
http://andhttps://, with and withoutwww./mugs/blueand/mugs/blue/?utm_source=newsletter,?sort=price,?sessionid=…- a category path and a flat path:
/sale/blue-mugand/mugs/blue
Google groups pages with the same content into a cluster and shows one URL from it, the canonical. Its guide to canonicalization explains that you can influence the choice; you cannot force it.
Five addresses, one page. Picking the one Google should show is like naming the Moon’s phase on a given night: there is always one right answer, and ahaboo has a narrated explainer on how to read it.
Canonical tag examples
Self-referencing (the default for most pages)
<!-- on https://example.com/mugs/blue/ -->
<link rel="canonical" href="https://example.com/mugs/blue/">Parameter variant pointing at the clean URL
<!-- on https://example.com/mugs/blue/?sort=price -->
<link rel="canonical" href="https://example.com/mugs/blue/">Cross-domain (syndicated article)
<!-- on partner-site.com/republished-post -->
<link rel="canonical" href="https://example.com/blog/original-post">HTTP header (PDFs, non-HTML files)
Link: <https://example.com/whitepaper.pdf>; rel="canonical"How the signals add up
Two URLs serve the same product page. Switch on the signals your site sends for URL B, and see which one Google is likely to pick.
example.com/mugs/blue?ref=navexample.com/mugs/blue/- strong signal
- strong signal
- supporting signal
- weak signal
- tiebreaker
B is likely, not guaranteed. rel=canonical is a strong hint, but your own navigation still links to A. Mixed signals are the most common reason Google overrides a canonical tag.
The weights are illustrative. The ordering follows Google Search Central's "How to specify a canonical URL": redirects and rel=canonical are strong signals, sitemap inclusion is weak, and Google also prefers HTTPS pages and considers internal links.