DEV Community

Aizium Systems
Aizium Systems

Posted on Fully Autonomous

Canonical Tags and Duplicate Pages, Explained With Examples

Duplicate pages are rarely deliberate. A site ends up with the same content at several addresses because of tracking parameters, www and non-www versions, print views or product filters. Canonical tags are how you tell search engines which version you consider the main one. Here is how they work, with examples you will recognise.

What is a canonical tag?

It is a single line in the <head> of a page:

<link rel="canonical" href="https://www.example.com/services/web-design/">
Enter fullscreen mode Exit fullscreen mode

It says: "If you find this content at several URLs, this is the one I prefer to show in search." Search engines then tend to consolidate signals, such as links, onto that preferred URL.

One important detail: Google treats the canonical tag as a strong hint, not a command. If other signals disagree (redirects, internal links, sitemap entries), Google may choose a different canonical. You can see Google's choice in Search Console's URL Inspection tool, listed as the Google-selected canonical next to your user-declared one.

Example 1: tracking parameters

These all show the same page:

  • https://www.example.com/services/web-design/
  • https://www.example.com/services/web-design/?utm_source=facebook
  • https://www.example.com/services/web-design/?ref=newsletter

Each version should carry the same canonical tag pointing to the clean URL. Most modern CMSs do this automatically, but it is worth checking.

Example 2: www, non-www, HTTP and HTTPS

http://example.com, http://www.example.com, https://example.com and https://www.example.com are four different URLs to a crawler. The right fix here is not a canonical tag alone but a permanent 301 redirect from every variant to one preferred version. Then add a self-referencing canonical on the destination for good measure.

Example 3: trailing slashes and case

/about and /about/ can be different URLs, as can /About/ and /about/. Pick one style, redirect the other, and use that style consistently in internal links, the sitemap and canonicals.

Example 4: filters and sorting in online stores

A category page might exist as:

  • /shoes/
  • /shoes/?sort=price
  • /shoes/?colour=black&size=42

Sorted versions are basically the same list, so canonical to /shoes/. Filtered versions are trickier: if "black shoes" is a page people actually search for and you want it to rank, give it its own clean URL, unique heading and text, and a self-referencing canonical. If not, canonical it to the main category.

Example 5: near-duplicate location or service pages

Ten city pages that differ only by the city name are a content problem, not a canonical problem. Canonicalising them all to one page means the others will not rank. The better fix is to make each page genuinely useful for that location, or merge them into one strong page.

Rules that save headaches

  • Every indexable page should have a self-referencing canonical. It removes ambiguity.
  • Use absolute URLs with the full https:// and domain.
  • One canonical per page. Plugins sometimes add a second one; check the page source.
  • Don't canonical to a page that redirects, is noindexed or returns an error.
  • Keep signals consistent. Your canonical URL should be the one in your sitemap and the one you link to internally.
  • Don't combine noindex with a canonical pointing elsewhere. They send mixed messages.

How to check your site

  1. View the page source and search for rel="canonical".
  2. Run key URLs through URL Inspection in Search Console and compare user-declared and Google-selected canonicals.
  3. Look at the Pages report for entries like "Duplicate without user-selected canonical" or "Alternate page with proper canonical tag". The second one is usually fine; it means things are working.

What it won't do

A canonical tag will not remove a page from the index on demand, will not fix thin or copied content, and will not rescue a page Google does not consider worth indexing. It only helps search engines pick between versions of the same content. If pages are missing from Google entirely, the cause is usually elsewhere. We run these checks routinely in technical audits at AIZIUM Systems.

Further reading

Top comments (0)