Canonical URL: What It Is and How to Set It Up Correctly
Canonical URL is the HTML tag rel="canonical", which tells search engines which single address among several similar or identical pages should be treated as the primary one for indexing. The tag sits in the <head> of the duplicate page and signals where all the search value — traffic, link equity, and rankings — should be consolidated.
How does it work?
Canonical URL is a signal for search engines, not a directive, so Google can ignore the declared address if other factors (internal links, the sitemap, redirects) point to a different page as the primary one.
The mechanism
When a crawler scans a page with a rel="canonical" tag, it records the declared address as a candidate for the canonical version. Google then weighs this signal against others: if the duplicate page gets more internal links or is the one listed in the sitemap, the search engine may pick it as canonical instead, ignoring the tag.
Ways to implement it
Canonical can be declared in three ways: an HTML tag in the <head>, an HTTP Link header (relevant for PDFs and other non-HTML files), or an entry in Sitemap.xml — the weakest signal of the three.
Why do you need it?
Canonical URL consolidates link equity and relevance signals from multiple duplicates into a single page, instead of spreading them across identical URLs that differ only by parameters (UTM tags, sorting, session IDs).
The tag also prevents internal cannibalization, where several versions of the same page compete against each other in search results, and it cuts down the crawl budget spent re-crawling identical content.
Example
<!-- On the duplicate page: example.com/shoes?color=red -->
<head>
<link rel="canonical" href="https://example.com/shoes" />
</head># Via an HTTP header (for example, for a PDF)
Link: <https://example.com/document.pdf>; rel="canonical"A self-referencing canonical on the primary page itself looks like this:
<!-- On the primary page: example.com/shoes -->
<link rel="canonical" href="https://example.com/shoes" />Common mistakes
Canonical points to a 404 or a redirect
The tag must point to a working page that returns a 200 status code, otherwise Google ignores the signal.
Different canonicals on identical pages
If several duplicates point to each other instead of a shared primary address, it creates a circular conflict, and Google picks the canonical version on its own.
Canonical pointing to a different language version
With hreflang in place, each language version's canonical must point to itself, not to one "main" language — otherwise the localized pages drop out of the index.
Canonical conflicting with robots noindex
If a page has both noindex and a canonical pointing elsewhere at the same time, the signals contradict each other — Google recommends picking one, depending on the goal.
A relative path instead of an absolute URL
The rel="canonical" tag must contain a full address with a protocol (https://), not a relative path — this lowers the risk of misinterpretation when the code gets copied elsewhere.
How do you check it?
In Google Search Console, the URL Inspection tool shows a "User-declared canonical" field (the tag you set) and a "Google-selected canonical" field (the address Google actually picked) — a mismatch between the two signals a problem worth investigating.
FAQ
Do you need canonical if the site has no duplicates?
No, but it's still recommended to place a self-referencing canonical on every page — it prevents duplicates that show up later from URL parameters.
Can canonical point to a page on a different domain?
Yes, cross-domain canonical is supported and gets used, for example, when content is syndicated across multiple sites, so all the value flows back to the original source.
Does canonical affect the page a user sees in their browser?
No, canonical is a signal exclusively for search engines. The user still opens whatever URL they clicked, and the page content doesn't change.
What happens if a page has multiple canonical tags?
Google ignores all the canonical tags on a page when there are several conflicting ones and determines the canonical version on its own, based on other signals.
Related terms
- Duplicate contentThe problem canonical solves by consolidating indexing signals onto one page.
- Robots.txtControls crawling of duplicates, while canonical works at the indexing level.
- HreflangThe multilingual tag that must align with a self-referencing canonical on each language version.
- 301 redirectA stricter way to consolidate duplicates: unlike canonical, it fully redirects the user.
- Meta robots (noindex)An alternative way to exclude a page from the index — shouldn't be combined with canonical carelessly.
- Sitemap.xmlShould list only canonical URLs so it doesn't send Google conflicting signals.
Prepared by the LuchanLabs team