A canonical tag is an HTML signal that tells search engines which address is the "master" version when the same or very similar content is reachable through multiple URLs. It is a single line added to the page's <head> section, but used correctly it plays a critical SEO role by preventing the ranking dilution caused by duplicate content.
Where the duplicate content problem comes from
Most site owners do not copy content on purpose; duplicate content appears on its own for technical reasons. The same product or article gets published on many URLs with tiny differences:
https://site.com/productandhttps://www.site.com/product(with/without www)http://andhttps://versions- Addresses with tracking parameters:
/product?utm_source=newsletter - Filter and sort parameters:
/shoes?color=black&sort=price - Versions with/without a trailing slash:
/blog/and/blog
Google may treat each of these addresses as a separate page. As a result, the link value and ranking signals for the same content get split across multiple URLs, and none of them is as strong on its own as it should be. This is exactly where the canonical tag steps in.
How to write a canonical tag
The canonical tag is added to the page's <head> section and points to the URL you want treated as the original:
<link rel="canonical" href="https://site.com/product">
You add this line to all variations of the same content (with parameters, with www, etc.) and point every one of them at the same master URL. The master page itself should also carry a self-referencing canonical pointing to itself; this communicates your preference to Google clearly.
An important point: a canonical is a suggestion, not a redirect. Google usually follows it, but it is not absolute. If the content is genuinely different or the signals conflict, the search engine may pick its own URL as the canonical.
Use absolute URLs and stay consistent
Always use the full (absolute) URL, including the protocol, for the canonical value. Relative paths (like /product) can be misinterpreted in some situations:
<!-- Correct -->
<link rel="canonical" href="https://site.com/blog/canonical-tag">
<!-- Risky -->
<link rel="canonical" href="/blog/canonical-tag">
The canonical must also not conflict with the rest of your site's signals. If the canonical points to one URL while your sitemap, internal links and redirects point to another, Google receives mixed signals. Decide on your master URL and use the same address across all of these channels.
Common mistakes
- Canonicalizing every page to the homepage: a frequent accident. If all pages point their canonical at
https://site.com/, Google may stop indexing the other pages. - Canonical and
noindexon the same page: a contradictory instruction. The canonical says "count this page as the same as that one," whilenoindexsays "do not index this page at all." Do not use them together. - Wrong use on paginated lists: do not canonicalize pages 2 and 3 to page 1; each page has different content and should be self-canonical.
- Canonicalizing to a blocked page: pointing to a URL that is blocked from crawling in
robots.txtdoes not work; if Google cannot see that page, it cannot read its canonical signal either.
Canonical via the HTTP header
Non-HTML files (such as PDFs) do not have a <head> section. In that case the canonical can be sent through the HTTP response header:
Link: <https://site.com/files/guide.pdf>; rel="canonical"
This method lets downloadable documents also link to their correct master address. You need to add this header from your web server configuration (for example Nginx or Apache).
Canonical or a 301 redirect
The two serve different purposes. If a URL will no longer exist and you want to move the user permanently to another address, use a 301 redirect. But if both URLs need to stay accessible (for example product pages with filter parameters), you cannot redirect; that is when canonical is the right tool. In short: if the user needs to see both versions, use canonical; if they should not, use a 301.
Frequently Asked Questions
Does a canonical tag directly boost my rankings?
It does not promise a direct ranking increase. What it does is consolidate scattered signals onto a single URL and clear up duplicate-content confusion. That in turn indirectly helps your master page position more clearly and strongly.
Should I add a canonical to every page?
Even on pages with no duplicate version, adding a self-referencing canonical is good practice. It protects you against parameter accidents when there are query-string addresses or any risk of duplication.
What happens if I put the canonical on the wrong URL?
You will have pointed Google at the wrong page as the original; the page you actually want may not be indexed or may not appear in search. So always check your canonical values before going live and verify them in Search Console's "Pages" report.
Do you have duplicate content on your site? Let's configure your canonical structure and technical SEO setup correctly together. Get in touch and let's review your site.