By Hextara team · Published · Last reviewed
The same content can be reachable at several addresses: with and without a trailing slash, with tracking parameters, through filters, or on both http and https. A canonical URL is the address you want treated as the main one. Google describes it as the version it is most likely to show in results when it finds duplicate or very similar pages.
Fix the cause first
Canonical tags are a signal, not a command. If your site creates five addresses for one page, the best fix is to make it create one: pick a single format, redirect the alternatives to it and link consistently. Use canonical tags for cases you cannot remove.
How to implement
- Add a self-referencing canonical tag in the head of every indexable page, pointing to its own preferred URL.
- Use absolute URLs, with the correct protocol and host.
- Generate the tag from the same function that builds your links, so they cannot disagree.
- Redirect non-preferred hosts and protocols to the preferred one.
- Do not canonicalize to a page that redirects, errors or is blocked.
Common mistakes
- Pointing every page's canonical at the home page.
- Mixing canonical tags with noindex on the same page, which sends conflicting signals.
- Canonical tags that differ between the HTML and what scripts later change.
- Including parameterized URLs in sitemaps, which should list only canonical addresses.
How to check
Crawl the site and compare each page's declared canonical with its own address. Review the Pages report in Google Search Console for pages where Google chose a different canonical than you declared, and investigate each pattern.
An example
A page reachable at /services/seo, /services/seo/ and /services/seo?utm_source=newsletter should have one preferred address. Redirect the trailing-slash version to the preferred one, ignore tracking parameters in the canonical tag, and make every internal link point to the preferred address. A search engine then sees one page rather than three.
Canonical tags and sitemaps
List only canonical addresses in the sitemap. If a sitemap lists one version and the page declares another, you are sending two conflicting signals.
A consistent policy
Write the rules down: lowercase paths, no trailing slash, no query strings in canonical addresses, one format per page type. A short policy applied in code prevents most problems.
