DEV Community

Gokul Kathirvel
Gokul Kathirvel

Posted on

Can I edit my old dev.to article to add a canonical URL to my recently setup personal blog?

I recently set up my personal blogging site, https://blog.gokatz.me/ and I wonder if I can add a canonical url to my blog from dev.to or I should do the other way by adding canonical URL to dev.to from my blog.

Top comments (7)

Collapse
 
ben profile image
Ben Halpern

Yup, add canonical_url: to the front matter.

Collapse
 
atapas profile image
Tapas Adhikary

Hi Ben,

Where do I have to add this in the editor? At the header or in the body? Before, there used to be UI to do this. Now I do not find it.

Could you please help with an example of where to add it in the blog editor?

Many thanks!

Collapse
 
atapas profile image
Tapas Adhikary

No worries, I got the option now :)

Collapse
 
gokatz profile image
Gokul Kathirvel

Thanks, Ben

Collapse
 
thefern profile image
Fernando B πŸš€

So I have setup my blog in github pages, and I am all setup with Jekyll.
This might be a silly question, what is a canonical_url used for?

Collapse
 
gokatz profile image
Gokul Kathirvel • Edited

The same blog content can be present in different parts of the web, say, in dev.to, medium.com and your personal website. Search engine ranking will be harmed if multiple pages has the same content. To avoid this, canonical URLs can be added to the replica pages (say, dev.to and medium.com) which will point the original content (your personal site). So that search engines can organize their search results without harming the ranking.

For more info, refer: yoast.com/rel-canonical/

Collapse
 
thefern profile image
Fernando B πŸš€

Awesome, thanks for the detailed info!