After this lesson you can find duplicate addresses on a site and apply the right fix for each. This is one of the most common technical SEO issues, and most of it can be solved with a few consistent habits.
What duplicate content is
Duplicate content means the same, or very similar, content reachable at more than one URL. Everyday causes:
http://andhttps://both working.wwwand non-wwwboth working.- With and without a trailing slash.
- Tracking or sorting parameters:
/shoes/?sort=price. - Print versions, session IDs, mobile-specific URLs.
- The same product in several categories.
- The same text published on two sites by you or syndicated.
None of these is automatically a penalty. Google's documentation describes how it groups such pages, chooses one as the canonical (the one to show in results), and treats the rest as alternates. The cost is mostly confusion: signals are split, the wrong URL may appear, and crawling is wasted. The spam case is different: copying other people's content to rank, which falls under scraping in spam policies.
How to signal your preferred URL
Google lists these methods, from strongest to weakest:
- A permanent redirect from the duplicate to the preferred URL. Use it when you can retire the duplicate. See redirects and status codes.
- A
rel="canonical"link on the duplicate pointing to the preferred URL: a strong signal. - Inclusion in the sitemap: a weaker signal. Only list canonical URLs (sitemaps).
Other signals that Google mentions: preferring HTTPS, and consistent internal links. All are signals. Google may still choose a different canonical than the one you name, if the evidence points elsewhere.
Writing the tag
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Feed a Sourdough Starter | Crumb & Co.</title>
<link rel="canonical" href="https://example.com/guides/feed-sourdough-starter/">
</head>
<body>
<h1>Feed a sourdough starter</h1>
<p>This page may be reached with tracking parameters; the canonical names the clean address.</p>
</body>
</html>Rules from the documentation, in plain form:
- Put it in the
<head>. - Use an absolute URL, with protocol and host.
- Add a self-referencing canonical on the canonical page itself.
- Use either the HTML element or the HTTP
Linkheader (useful for PDFs), not both with different values. - Point to a page that works: a 200 status, and indexable.
- Do not use URL fragments as canonicals, and do not point to a redirecting URL.
- If you set it with JavaScript, keep it the same as in the HTML, because Google warns about conflicts.
Real example
This site's metadata helper in src/lib/seo.ts sets an alternates.canonical for every page from the page's own path, with trailing slash. Its audit script then compares the canonical in each built page against that page's address and reports a mismatch as an error, and also errors if canonicals use more than one host. The design aims at the situation described above: one clean address per page, checked automatically.
Do not mix signals
Do not canonicalise page A to B while A is noindex, or while sitemaps list A. Mixed messages make Google guess. Do not block duplicates in robots.txt either, because the crawler then cannot see the canonical tag. Google specifically advises against robots.txt for canonicalisation.
Cases to think through
- Parameters: sorted or filtered lists usually canonicalise to the clean category, unless the filtered page is genuinely distinct and valuable.
- Syndicated content: if another site republishes your article, ask them to link to the original and, where they can, to use a canonical pointing to yours. They may not.
- Pagination: each page in a series is usually its own page; see pagination and hreflang. Do not canonicalise page 2 to page 1.
- Language versions are alternates, not duplicates.
- Near-duplicates: ten pages that differ only by a town name are a content-quality problem that canonicals will not fix.
Checking it
View the source of a page and search for rel="canonical". In Search Console, URL Inspection shows the canonical you declared and the one Google selected. If they differ, find out why: often a redirect, a mixed signal, or a page that really is a near-copy.
Common mistakes
- A canonical on every page pointing to the home page.
- Relative or incorrect canonical URLs.
- Multiple conflicting canonical tags.
- Canonical pointing at a 404 or a redirect.
- Using noindex to try to pick a canonical.
- Believing duplicate content leads to a penalty in ordinary cases.
Exercise
Your page lives at https://example.com/classes/sourdough/. List five URLs that might show the same page, and decide for each whether to redirect or use a canonical.
Show a sample answer
http://example.com/classes/sourdough/ and https://www.example.com/classes/sourdough/ should permanently redirect to the preferred address. https://example.com/classes/sourdough (no slash) should redirect too. https://example.com/classes/sourdough/?utm_source=mail can stay reachable for tracking and canonicalise to the clean address. A print version at /classes/sourdough/print/ can use a canonical, or be avoided by using print styles. The principle: retire accidental duplicates with redirects, and use canonicals where the duplicate must keep working.
Key points
- When several URLs show the same content, Google groups them and picks one canonical URL to show.
- You signal your preference with redirects (strongest), rel=canonical (strong) and sitemap inclusion (weaker); these are signals, not commands.
- Use absolute URLs, a self-referencing canonical, and put it in the HTML head.
- Ordinary duplicate content is mostly a consolidation problem, not a penalty; copying others to manipulate rankings is spam.