Making Search engines happy is not that hard
One of those SEO terms you know you need to learn, but you were just lazy as me. Or maybe you just do not care. Well, you should care. Here is why.
According to Wikipedia, it is a standard, a rule or primary source of authority. Basically, it means the source of truth.
“The adjective canonical is applied in many contexts to mean "according to the canon" – the standard, rule or primary source that is accepted as authoritative for the body of knowledge or literature in that context.”
Canonical URLs are telling search engines that the page they are visiting is the original content (in the case of duplicate content). This can be done in two ways:
<link rel="canonical" href="https://example.com">
Of course, you need to change example.com to your own domain.
Link: <https://example.com>; rel="canonical"
As you can see this is really not so complex. Most of the static site generators and content management systems nowadays have those features built in, or you can easily add those with plugins.
As a developer you should know what those tags (or headers) are used for, why they are useful and why you should care.
As you can see from the above, canonical URLs are super simple to set up, but why should you care about them on your website?
If you are doing content syndication those can be super useful, at least when you are starting out. Content syndication means publishing your content on more than one domain (platform) at a time.
So, let's say that you are writing a post on your website, but you also want to publish it on other platforms, like medium.com, dev.to or hashnode.com. There is no way you can compete with these domains in terms of domain authority. This means that, to Google, they are more valid sources of content then your small and less visited website. However, you can leverage the reach that those platforms can give you and put your original post as a canonical URL on those platforms. This way you are telling Google (and other search engines) that the content is originally posted on your website. In this case Google will notice duplicate content, as you would actually publish the same content on various domains. But, the original source of content will always be your website, and therefore you would build up your domain authority.
I hope I demystified the Canonical URLs a bit for you. For a long time I did not learn this properly. Now it is clear to me what they are and what they are used for. Next year I will eat my words and will start with the content syndication to try and leverage the reach that those external platforms can give me. Let’s see how it goes.
I am a self-taught Web Developer. My mission is to explain things in a simple but understandable way. During the years, I have helped several Junior Developers kick start their careers, land an internship or a job or just in general get over the coding hurdle that they encountered.