Canonical URL

A simple guide to using the Canonical URL tag, and tips on avoiding duplicated content in the SERPs.

1536 views
d

By. Jacob

Edited: 2019-12-15 18:23

rel canonical, SEO

The rel=Canonical URL allows you to tell search engines that duplicated content available on other URLs are actually the same content as that available on the Canonical URL.

When servers are configured incorrectly, or CMS systems are designed with little forethought, content may sometimes become available on multiple URLs. A common situation where this may occur, is when using the WWW subdomain. Another is when the index file (I.e. index.html), is accessible both from http://beamtic.com/index.html and http://beamtic.com/.

A simple way to solve this problem is to simply block requests for the index file, or redirect them to the bare domain. Another, less desirable solution, is to use the link tag with the rel=canonical attribute set. The tag can be included in all versions of the page.

<link rel="canonical" href="http://example.com/">

If you are using PHP, and you want to prevent access for non-existent URL paramerters (query strings), you should see this article: Blocking Out Non-Existent URL Parameters

Canonical URL Tag

Sometimes you might not be able to configure the server properly, for whatever reason – usually due to host specific limits. In those cases, you may want to include a Canonical URL Tag, which tells the search engines which URL you want to show up in the SERPs.

Including the below code in your head section, would suggest that only http://beamtic.com/ be used – just replace beamtic with your own domain name.

<link rel="canonical" href="http://example.com/">

SEO Benefits

Generally, there are no SEO benefits unless you are already having problems with unwanted URLs in search engines.

If you can not fix a possible problem with your site causing duplicated URLs, then you may want to still use the canonical meta tag to, as it could help you avoid potential problems with duplicated content.

There is at least one good reason to use canonicals, and that is when third parties incorrectly add tracking parameters to your URLs such as Facebook's "fbclid" parameter. These parameters do not exist in your application, and should result in a 404 error under normal circumstances.

Since we have no control over third party implementations, it is probably best we white-list certain URL parameters, and then simply either redirect users, or add a canonical if the tracking features are important to us.

Canonical URL vs 301 Redirect

It is actually best to avoid both redirects and canonicals. The best thing to do, is always to configure your server and CMS correctly from the start, as it avoids all of these issues with duplicated content.

Even when the damage is already done, it may sometimes be best to just throw a 404 error on the old duplicate URLs, rather than spending time redirecting each and every page. If you have a lot of incoming traffic from those old moved URLs, you could consider if it would be worth the effort to also redirect them.

Please also note, someone with technical skills will generally be able to redirect old URLs without major problems. This sometimes might depend on the CMS and server you are using, but modern CMS should offer this capability. In general, it should not take longer than a few minutes or a small hour to redirect even hundreds of pages. Rather than using the build-in tools in your CMS, it may sometimes be more reliable to have a list of URLs to redirect, and then include it directly in your server configuration (Apache makes this very easy). Note. This does require some basic knowledge of servers, but again, I think it is highly worth it. Someone who is knowledgeable in this area will often be able to automate the task via scripts.

There is a lot of disagreement about redirecting and use of canonical, but the technical side of things is clear, and the standards are clear. It makes no semantic sense to redirect a page that has been deleted, and also, having a lot of duplicated pages is simply unprofessional. It should not happen in a proper configuration. I am afraid, if you do have problems in this area, you might have many other issues with your website as well, including security related problems.

See also

  1. Trailing slashes in URLs

Tell us what you think:

  1. Drop in traffic doing recent helpful content updates; time will tell if I will recover.
  2. Let us investigate what is up with those mass spammed *-k.html backlinks that many of us are seeing in our link reports.
  3. An in-dept look at the use of headings (h1-h6) and sections in HTML pages.
  4. Pagination can be a confusing thing to get right both practically and programmatically. I have put a lot of thought into this subject, and here I am giving you a few of the ideas I have been working with.
  5. The Video outside the viewport is properly not worth spending time on solving; it is probably intended to solve a specific issue, and every single little video probably does not need to get indexed anyway.

More in: SEO