How to Add Canonical Urls to WordPress Blogs

Updated May 24, 2020 • Posted June 6, 2013 • By P Chandra

It is very essential to add canonical URLs to every WordPress blog web page to avoid duplicate content penalties by search engines. Canonical URLs represent the permalink of the page and help search engines identify and index the page, ignoring other parameters or mistyped URLs loading similar content.

Add Canonical URLs Easily

1. WordPress AutoInsert

The latest versions of WordPress automatically adds the canonical URL to the posts and pages only, but not to archives, tags, categories, etc. So while for most blogs, it takes care of all your single posts and pages, it does not fix canonical URL issues for your archives and other paginated categories/tags.

2. SEO WordPress plugins

Popular SEO WordPress plugins like All in One SEO or Yoast SEO have options to set canonical URLs on all your blog pages and are the best way to add canonical URLs in on click.

3. Premium WordPress Theme Frameworks

Some advanced theme frameworks like Thesis and Genesis have SEO options that allow the auto setting of canonical URLs, without the use of above SEO plugins. However, they are paid WordPress themes, and most WordPress themes might not have options to set canonical URLs automatically.

4. Manual Code Addition

If for some reason you wish to add canonical URLs to all your single posts and pages manually, you can add the following code in the HEAD tags of your HTML code by editing header.php

Similarly, if you want to add code manually to any page, you can simply add the canonical URL on the page in the HEAD tags. For example, we have a problem using SEO plugins because we host WordPress in an alternative directory and the SEO plugins cannot create the correct URL for the front page. So we directly add our main front page canonical URL through a separate index.php file.

There are indeed many options available for adding canonical urls to WordPress blogs. The major point should be that the blogger remembers to apply this with automated plugins or by manually. The choice should depend on the ease with which any can be applied.

Having said that, I think this is a helpful post as it lists and explains four very helpful steps that could be applied to add canonical urls so that search engines would easily read a post and index it!

I found simply the information I already searched all over the place and simply could not come across. What a perfect web site.Good Blog sir… your blog is very helpful.. I am happy to find this post very useful for me, as it contains lot of information