@kentgigger

What Is A Canonical URL

Authors

What Is A Canonical URL?

As a website grows, it's easy to run into duplicate content issues. If you've got two like minded pages, and they're both eligible to rank for a certain keyword, the search engine doesn't know which of the two URLs it should send traffic to. To solve this problem, you can select a preferred URL—called the canonical URL—so that search engines know which page is the real deal or your top page you want to rank in search engines.

A canonical page is the representative of a group of duplicate pages from one a domain. In other words, it's the version of a given page that Google thinks is the best for the keyword.

Table of Contents

Same Content, Different URLs

A canonical URL is a the technical wording for duplicate content. You might, for instance, have a post or a page that talks about the same thing very closely.

For example: Same Domain

https://yoursite.com/mypage/

https://yoursite.com/mypage-new/

If these two URLs lead to the same content, choosing one as the canonical URL tells Google and other search engines which URL to show in the search results. With all of Google's powers it doesn't know what is the most relevant content so you have to tell it what you would like be visible in search.

Same Content, Different Domains

Canonicals can be used to send search engines to the original version of a post. For instance, say you’ve written a post on dev.to, medium.com or something similar. You want your published content there on those websites but the original post is from your site. In this instance you would add a canonical URL1 pointing to the original version on your site.

For example: Different Domains

https://yoursite.com/mypage/

https://anothersite.com/mypage-duplicate/

What Does A Canoical URL look like?

A canonical URL can be seen in the source of a webpage, by searching for rel="canonical". You won’t see it, and neither will your users.

<link rel="canonical" href="https://yoursite.com/dresses/green-dresses"/>

To 301 Or To Not 301 That Is The Question

Choosing a proper canonical URL for every set of similar URLs can have you climbing the search engine rankings ladder in no time. This is because the search engine knows which version is canonical and can count all the links pointing to the different versions as links to the canonical version. In concept, setting a canonical is similar to a 301 redirect, only without the actual redirecting.

The best way to answer this question is to think in a straightforward, linear fashion: you should always redirect unless there’s a good reason not to. If you can’t redirect because that would harm the user experience or be otherwise problematic, set a canonical URL. Like if the post is on another domain. I haven't started posting on Medium or Dev.to. however, if you do, this is a way to get a search engine crawl back to your site with out a direct link.

Should A Page Have It's Own Self-Referencing Canonical URL?

The question of whether a page should set a rel=canonical for itself is hotly debated amongst SEOs. Personally, I strongly recommend having a canonical link element on every page, and Google has confirmed2 that’s best. That’s because most CMSs allow URL parameters without affecting the content.

If you were to inspect this page you will see in the <head> that this page has a canonical URL. <link rel="canonical" href="https://kentgigger.com/blog/canonical-url">

Final Thoughts

You should be doing this as the problem is that if there’s no canonical URL on a page, you risk being penalized for duplicate content. And if someone else creates that canonical URL, it could cause you problems. So adding a self-referencing canonical to all of your URLs is a good safeguard. One of the many reasons to use a CMS like WordPress with a SEO plugin that will do this without you having to think about it.

I hoped this helped you.

Footnotes

  1. https://developers.google.com/search/docs/advanced/crawling/consolidate-duplicate-urls#:~:text=The%20canonical%20URL%20can%20be%20in%20a%20different%20domain%20than%20a%20duplicate%20URL

  2. http://www.thesempost.com/using-rel-canonical-on-all-pages-for-duplicate-content-protection/