The Hands-On, Dirty Guide to the Canonical Tag

canonical tag guide

Duplicate content.

Unless you’ve been doing SEO on a deserted island, you should know this term quite well.

Search engines have been getting stricter in policing this issue. And websites caught with instances of identical content often end up losing traffic and rankings.

But luckily there’s a solution. It’s simple, quick and often misunderstood.

Here’s a short guide that might shed some light on it.

Enter Canonical Tag

The solution I’m talking about is called a canonical tag. Its role is simple – to tell a search engine which is the original version of the content to display in search results.

Canonical tag is a short meta-tag you place in the <head> section of your HTML code.

It looks like this:

Canonical Tag

(Canonical Tag on my previous post here on

To fully understand why you need to include it, let’s look at the broader issue.

Where does duplicate content come from?

It may seem obvious that knowing the seriousness of duplicate content, no one would actually dared to create it, right?

Unfortunately, a lot of the time due to the growing intricacies of web technology, duplicated content is created as a side effect of other processes. For instance:

Multiple URLs pointing to the same page. This if often a result of URL being dependent on different variables such as size, color etc. For instance:

Domain and Subdomain. Search engines see and as two separate URLs. To them, the former is the main domain and the latter, a subdomain. Search engines will then crawl and index both as individual URLs.

Session and other IDs. Your system might be automatically generating unique URLs that include session IDs or tracking reference, breadcrumb link or permalinks, i.e.

Mobile website. Search engines will see your mobile URL as a separate web address as well.

Country or Location URLs. Lastly, location specific URLs where the content might largely remain the same  might cause duplicate content issue as well. A good example here is hotels operating properties in different locations but offering the same content in each.

Canonical tag works like a magic potion solving all those problems. It simply tells the search engine which URL is original and thus should be crawled and indexed.

How to use it

In most cases the usage of canonical tag is automatic. A lot of CMS systems like WordPress either have this option built in or available through a dedicated plugin (see: Yoast SEO).

But depending on your set up, you might have to include it manually.

Here’s how a canonical tag looks like:

<link rel=”canonical” href=”” />

You should place it within the <head> section of HTML code on each page and the URL should list the only URL for that page you want the search engine to index and return in search results.

What happens if you incorporate it incorrectly?

I am going to resort to a 3rd party experiences to explain this. A few years ago Dr.Pete did a test in which he canonicalised all pages on his site to a home page. This means that every canonical tag, regardless of what page it was on pointed to a home page.

The results?

  • A drop in number of indexed pages
  • Various pages getting replaced by home page in SERPs and losing rankings
  • Drop in organic traffic

You can read the whole story here.

What else can go wrong with canonical tag?

Apart from setting a single particular URL as a preferred one across the entire site, a mistake that’s easy to happen if you manually copy and paste the canonical tag on each page, other things that can go wrong include:

Using multiple canonical links on a page. You should include only one canonical tag on a page. In case if there are more, all of them will get ignored.

Wrong placement. It’s easy to paste the code in a wrong place, especially if you don’t have much knowledge of HTML. Doing so might not cause any problems with the site’s performance but of course your canonical tag won’t work for the purposes intended.

Key Takeaway

Duplicate content happens. In spite of your best efforts, your CMS might create multiple URLs for the same page, include session IDs and many other things.

To avoid losing rankings and traffic, add a canonical tag to your pages to denote which URL is original and should be displayed in search results.


Creative commons image by Andy Cross / Flickr

Leave a Reply

Your email address will not be published. Required fields are marked *