What is a Canonical tag?

To put it simply a canonical tag is an HTML tag used to indicated to search engines that similar URLs are actually the very same page. The canonical tag is added to pages using a link element in the HEAD of the HTML document.

If two URLs contain the same canonical tag this indicates to search engines to index the pages as a single entry.

For example take the following URLs:

  • https://www.liquidweb.com/kb/
  • https://www.liquidweb.com/kb
  • https://liquidweb.com/kb/
  • https://www.liquidweb.com/kb/?hello=world

Technically these are all the same exact place, meaning they all pull up our KB home page even though they have differing URLs. To Google and other search engines these all would be indexed and crawled as individual pages, even though they’re all the same exact content.

Enter the Canonical tag!

With use of the canonical tag we can indicate to search engines that these differing URLs all serve the same resources or page. Continuing with our example the canonical page used would look like:

<link rel="canonical" href="https://www.liquidweb.com/kb/">

With this Meta tag included in our documents HEAD, then we should see all of the example URLs indexing as the same page.

Exactly what does a Canonical tag do?

Canonical tags specify for Search Engines what the ideal URL to index a page our resource is. Like most other HTML meta tags, the canonical tag doesn’t directly affect how a user interacts with your website. It simply helps you signal to search engines what your preferred URLs are.

Why should I use Canonical tags?

Canonical tags should be used anytime you’re serving the same content from multiple URLs. The affected URL variations include changes to: protocol (http vs https), query parameters, and (of course) URL structure. Implementing Canonical tags is especially useful if you serve the same content over various URLs. This is often referred to as the “Duplicate Content” problem when looking into a websites SEO performance.
Additionally, in the case of URLs with query parameters, it helps ensure that search engines only index a page with the “cleanest” form of the pages URL. This can help prevent pages with query parameters from being indexed separately from your main page.

To 301 redirect, or to Canonical; that is the question.

If you’re familiar with the topic of SEO then you know just how important properly redirecting your URLs can be. So you may be wondering, “Why not just redirect these pages?” and that’s a great question! If you ever have the option you should always add a redirect. Think of canonical tags as a way of clearing up a potential ambiguity (if the same content is visible on two pages), where as a 301 redirect removes any potential ambiguity. That said, you should essentially always aim to include Canonical tags since they help cover URL variations based on query parameters as well.

Canonical tags and You!

So as we’ve explained Canonical tags can be a very powerful tool in a web professional’s toolkit. By properly implementing Canonical tags you can often see an improvement in the way your website preforms in search. As with all great power comes great responsibility; this article should serve as a primer for your knowledge on Canonical tags, but the journey shouldn’t end here. There are a lot of great resources that go into greater detail on Canonical Tags, the best practices around them, and so much more!

Be Sociable, Share!

    Author Bio

    About the Author: Dan Pock

    Dan Pock does Technical Writing & Marketing at Liquid Web with a background in System Administration, Public Relations, and Customer Service.

    His favorite things include: his cats, Oscar Boots and Dash Nouget; experimenting with PHP; and making up recipes (or at least attempting to). You can find his coding hijinks on GitHub, where he shares most of his projects and open source work.

    Here's 75 % off, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support