How to use the Canonical tag

What is a canonical tag?

A canonical tag is used as a signal to search engines that the nominated version of a URL is the version you want them to index and return in their results.

A canonical tag (aka “rel canonical”) is a way of telling search engines that a specific URL represents the master copy of a page. (MOZ)

What is a canonical tag used for?

A simple way to understand what a canonical tag is used for is to look at a website’s homepage – https://www.examplesite.com.

To a human, the homepage is the homepage. We don’t really care how we navigate to it, or how the final URL appears in the address bar.

However, there can be numerous different URLs which all appear similar to the user:

  • https://www.examplesite.com
  • https://examplesite.com
  • http://www.examplesite.com
  • http://examplesite.com
  • https://www.examplesite.com/index.php
  • etc etc….

Landing on any of the above URLs will show you the same content, the same page structure – essentially, the same page.

However, to a search engine crawler/bot, all these variations represent an individual webpage, meaning there is no one, true homepage from the search engine’s point of view. This can lead to lower rankings as your homepage’s authority (or whatever proprietary metric you’d like to use) is split between 2, 3 or even 6 versions of the same page.

This problem can become clear when your site uses sessions IDs, product search parameters or pagination. Each of these scenarios can create multiple versions of the same content on different URLs.

You only want and need one URL for each page to be indexed by search engines.

duplicate-content-moz
(image source: MOZ, Duplicate Content)

How is a canonical tag implemented?

There are a few different methods of implementing site-wide canonical tags, but for simplicity and ease of use, the Yoast SEO Plugin (for WordPress) is a favourite.

Not using WordPress or another user-friendly CMS? You may need to manually add the snippets onto the relevant pages and templates.

The following HTML needs to go into the head section of the page’s code, in this case the mobiForge homepage.

This exact same snippet should appear on all versions (including the canonical, master version) of the mobiForge homepage, ensuring Google/Bing or whoever else sends their bots to visit will know which version we’ve chosen to be our one, true homepage.

For category, blog and product pages, the same logic applies. By setting a default canonical for each instance of duplication, you ensure the correct version will feature in search results and your pages aren’t battling with their doppelgangers for search traffic.

canonical-pages
(image source: ContentKing)

When isn’t a canonical tag the right solution?

In some cases, it’s better to use redirects than canonical tags, despite the latter usually being an easier solution to implement.

If you’ve recently migrated your website to HTTPS, the old URLs should be (301) redirected to the new URLs, to benefit both your search presence and your visitors’ security. In this instance, a canonical isn’t a great solution as users will still be able to navigate to your non-secure pages.

Unless there’s a solid reason why your visitors should be able to view a URL, such as ordering products by size, colour etc, then a redirect is the better solution where pages contain identical (or almost identical) content.

Further reading

Leave a Reply

Exclusive tips, how-tos, news and comment

Receive monthly updates on the world of mobile dev.

Other Products

Market leading device intelligence for the web, app and MNO ecosystems
DeviceAtlas - Device Intelligence

Real-time identification of fraudulent and misrepresented traffic
DeviceAssure - Device Verification

A free tool for developers, designers and marketers to test website performance
mobiReady - Evaluate your websites’ mobile readiness

© 2024 DeviceAtlas Limited. All rights reserved.

This is a website of DeviceAtlas Limited, a private company limited by shares, incorporated and registered in the Republic of Ireland with registered number 398040 and registered office at 6th Floor, 2 Grand Canal Square, Dublin 2, Ireland