Skip to content
Guide

Canonical tags explained: what rel=canonical does and when to use it

The same content can live at more than one URL. A product shows up at its own address and again under a category path. A page answers to both the www and non-www versions. Tracking parameters tack themselves onto the end of a URL every time someone shares it. To you it is one page; to a search engine it looks like several near-identical ones.

The canonical tag is how you tell search engines which version is the real one. It is a small line in the page's head, and it quietly does a lot of work to keep duplicate URLs from competing with each other. It is also easy to get wrong in ways that do not throw any error, so the mistakes tend to sit unnoticed until rankings drift.

What rel=canonical does

A canonical tag is a link element in the head of a page that names the preferred URL for that content. It looks like a single line pointing at the version you want indexed. When a search engine finds the same or similar content at several URLs, the canonical tag tells it which one to treat as the master copy and show in results.

Crucially, a canonical tag is a hint, not an order. Search engines usually respect it, but they can override it if your other signals contradict it, such as internal links and sitemaps that all point somewhere else. So a canonical works best when the rest of your site agrees with it, rather than as a lone instruction fighting everything around it.

When to use one

Use a canonical tag when the same content is reachable at multiple URLs that you want to keep live. The tag consolidates them into one for search purposes without removing any of them for visitors.

  • A product or article that appears under several category or filter paths.
  • URLs that differ only by tracking parameters or session IDs.
  • Printer-friendly or AMP versions of a page that duplicate the main one.
  • Pagination or sort variations that show largely the same content.
  • Syndicated content, where the canonical points back to your original on the site that republished it.

Canonical or redirect?

These two get confused, but the test is simple: do you need both URLs to stay accessible? If yes, use a canonical. If no, use a redirect. A canonical keeps every version reachable for visitors while pointing search engines at the preferred one. A 301 actually sends everyone, people and crawlers alike, to a single URL and retires the other.

So a tracking-parameter version of a page should canonical to the clean URL, because visitors still need to land on it when they click the shared link. An old URL that has genuinely moved should 301 to the new one, because there is no reason to keep the old address working. Reaching for a canonical when you meant a redirect leaves duplicate URLs live and only partly consolidated.

Common mistakes

Most canonical problems are quiet. Nothing breaks, no error appears, and the page looks fine, which is exactly why these slip through.

  • Every page canonicalizing to the homepage, which tells search engines your whole site is one page and can drop everything else from the index.
  • A canonical pointing at a URL that redirects or returns a 404, which sends a confusing signal and usually gets ignored.
  • Canonicals using relative or http URLs on an https site, or a different domain casing, so they do not match the live address.
  • Self-referencing canonicals that point at the parameterized URL instead of the clean one, so the duplicates never consolidate.
  • A canonical that contradicts the sitemap and internal links, leaving search engines to guess which signal to trust.

How to check yours

View the page source or use a meta tag checker to read the canonical tag the page actually outputs. Confirm it points at the exact preferred URL, with the right protocol and domain, and that the target returns a clean 200 rather than redirecting or erroring.

On most pages the simplest correct setup is a self-referencing canonical: the page points at its own clean URL. That covers the parameter and casing duplicates automatically and gives search engines an unambiguous answer. Spot-check a few template types across the site, since a canonical bug usually lives in a template and repeats on every page that uses it.

Frequently asked questions

Is a canonical tag a redirect?
No. A redirect sends every visitor and crawler to a single URL and retires the other. A canonical tag keeps all the URLs reachable for visitors but tells search engines which one to index. Use a canonical when both URLs must stay live, and a 301 when one should be retired.
Does a canonical tag guarantee the chosen URL gets indexed?
No, it is a strong hint rather than a command. Search engines usually honor it, but they can pick a different URL if your internal links, sitemap, or other signals point elsewhere. Make sure the rest of your site agrees with the canonical so the signal is consistent.
Should every page have a canonical tag?
A self-referencing canonical on every page is a safe default. It points each page at its own clean URL, which automatically handles parameter and casing duplicates. The mistake to avoid is canonicalizing many different pages to one URL, such as the homepage, which can deindex the rest.
What happens if my canonical points to a redirect or 404?
It sends a contradictory signal. You are naming a preferred URL that itself is not a valid final page, so search engines tend to ignore the canonical and choose a URL themselves. Always point the canonical at a URL that returns a clean 200.

Related tools

Related guides

Check it with Sitewell

Put this guide to work on your own site

Sitewell’s free tools run the exact checks covered above — no signup, results in seconds.