A Guide to Canonicals – All you need to know to improve your SEO

A Guide to Canonicals – All you need to know to improve your SEO

In this week’s technical SEO spotlight, we look at the wonderful world of canonicals. Now you may have heard people mention canonicals, canonical tags, or canonicalisation (try saying that three times fast…) but it’s not always easy to understand what these things are. In this blog we’re going to explain canonicals in simple terms, and show you examples of where to use them.

Example of a canonical on the KangarooSEO blog 

What is a canonical tag?

A canonical tag is a snippet of code that defines the master version of a page, in situations where there are duplicate versions or very similar versions of the page. Canonical tags are mainly used for search engines, so these search engines know which version of the page to index (e.g. the master), and which versions to ignore.

Although Google will usually respect the canonical URL you set 99% of the time, remember that on some rare occasions, they may ignore it as canonical tags are hints and not directives.

Canonical tags should live in the <head> section of a web page, and are written in HTML. They look like this:

<link rel=”canonical” href=”https://website.com/blog/1” />

The link rel=”canonical” part is identifying the main version of the page e.g. the master version that you want to be indexed. And the URL you want to be that main version is the one you put after the ‘href’ e.g. href=”https://website.com/blog/1”.

Why are canonical tags important for SEO?

Google does not like duplicate content as it can view it as plagiarisation (e.g. someone stealing your content), or a technical fault (you’ve published the same page twice by accident). If Google thinks you’re acting in bad faith, it could punish you by not ranking your pages highly, affecting your domain authority and general visibility.

However there are occasions where you may have similar or duplicate content on your website, so canonical tags provide a useful way of identifying this and communicating it to search engines. It stops you from diluting your traffic across multiple versions of the same page, and it allows you to include things like parameters or session IDs in URLs, without having to index all of those different versions of the pages.

Examples of where you should use canonical tags

Here’s a list of occasions where you should consider using canonical tags to help Google understand your pages and better rank your content:

1. Having parameters in your URL

If you include parameters in your URLs, for example session IDs, different colour options, or search parameters, you should always include canonical tags on these pages to help identify the original page.

For example the following pages may all display the same page, but the URLs differ: www.website.com/home/?sessionid=3 

www.website.com/home/q=search-term

www.website.com/home

2. Having pages with and without trailing slashes

A technical issue we see on a lot of websites is where pages both with and without the trailing slash are being indexed in the search results. This can cause cannibalisation and wasted SEO efforts.

The two pages both ranking may look like this:

www.website.com/home

www.website.com/home/

Putting in place canonical tags is the most efficient way to fix this issue.

3. Having a blog or news section across multiple pages

If you have a news or blog section that spans across multiple pages, you don’t want every single page to rank in Google. Ideally you just want the blog landing page to be indexed, and users will navigate from there. Therefore you should canonicalise all your blog pages, signaling the homepage as the main one.

Your pages may look like this:

www.website.com/blog/1/

www.website.com/blog/2/

www.website.com/blog/3/

How to implement canonical tags on your pages?

Implementing canonical tags is quite easy – you just need to make sure that every page you want to reference (whether it’s the master page or the duplicated versions) include the canonical tag in the head section of the html code.

For example, if you have a blog with multiple blog pages, you want to canonicalise all of these and identify the first one as the master. So to do this you would:

Add a self-referencing canonical tag on the master version of the page, so on the page:

www.website.com.blog you would add the code:

<link rel=“canonical” href=“https:/www.website.com.blog” />

On all the other versions of the blog pages, add this snippet of code in the head. So on the page: www.website.com/blog/1 you would also include the code:

<link rel=“canonical” href=“https:/www.website.com.blog” />

Some final key things to remember: 

  • When writing the URL, always write the full URL including the https:// bit
  • Use one canonical per page, if you add two or three, Google will ignore them, so stick to one
  • Always use lowercase URLs as Google differentiates between uppercase and lowercase
  • Don’t include your non-canonicalised URLs in your sitemap, there is no need

Canonical tags are not confusing or scary, although they are hard to pronounce. The key with canonicals is if you think you should have one on a page, you probably should add one just in case. And as there is no harm in self-referencing canonicals, you’re better to be safe than sorry.