A Guide to Canonicalization for WordPress

A Guide to Canonicalization for WordPressIgnorance is most definitely not bliss when it comes to the world of SEO.

If you want to maximize your rankings in Google (and ensure that you are not penalized), you must take ownership of every element of SEO — from your link profile, to your onsite optimization, and so on.

This can seem unfair for beginners — after all, how are you supposed to know what to do? The simple answer is that you can’t know. The productive answer is that whilst you can’t know, you need to learn.

With that in mind, today I want to address one relatively simple element of SEO that many WordPress users do not even consider — canonicalization. It isn’t particularly glamorous, but it is important, and you have no excuse not to get it right.

Featured Plugin - WordPress Infinite SEO Plugin

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

What is a Canonical Page?

I can’t put it better than Google:

A canonical page is the preferred version of a set of pages with highly similar content.

To explain the purpose of canonical pages, we must first explore the issue of duplicate pages. For example, try accessing your site in the following ways:

http://yoursite.com/

http://www.yoursite.com/

You will find that both methods work. Another example would be any web page that has modifiers added to the end of the URL. You could have an e-commerce site where the exact same product page can be found across various different URLs, depending on how filters are set and so on.

The problem with these multiple instances of the same content is that Google will probably index most (if not all) of the pages on your site. Then it has to decide which one it thinks is the correct page to push up through the rankings.

It would be far more preferable if you could help Google to understand which pages are carbon copies of each other, so that they can selectively index only what is necessary. That is where canonicalization comes in — you tell Google which is the preferred page for indexing and ranking.

How Do I Set “Preferred” Pages?

Please note that you never really have full control over what Google does and doesn’t index (unless you go down the “noindex” or manual URL removal route). Good canonicalization is about demonstrating to Google what version of a page you think they should prioritize in their index. Their algorithms will then take that suggestion into account when assessing your site’s pages.

With the above in mind, there are three things that a WordPress user should do to ensure that their site is correctly optimized in terms of canonicalization.

1. Verify the Homepage’s Canonical URL in WordPress Settings

The first thing you need to do is make a decision as to whether your site should primarily be accessed via “http://”, or “http://www”. You do this by setting the WordPress Address in General Settings:

WordPress Canonicalization

WordPress will set up a 301 redirect from the “secondary” URL to your preferred canonical URL. So in the above example, if anyone tries to access your website via “http://mywordpresssite.com/”, they will be automatically redirected to “http://www.mywordpresssite.com/”. Furthermore, any backlinks that point to a non-canonical URL will be automatically forwarded via the 301 redirect.

2. Verify the Homepage’s Canonical URL in Google Webmaster Tools

Next you need to tell Google which URL you prefer. You do this by first adding both URLs to your Webmaster Tools account — Google considers them separate entities. Once you have done that, you need to set the “Preferred domain” via Configuration > Settings:

Google Webmaster Tools

As you can see from the above screenshot, the preferred domain for my blog is “http://www.leavingworkbehind.com/”. This preferred domain needs to be set correctly on both accounts in your Webmaster Tools.

3. Set Canonical URLs for All Pages On Your Site

This final step may sound a little daunting, but it is in fact the most straightforward. First, install and activate one of the popular SEO plugins, such as All in One SEO Pack.

Once activated, navigate to the settings and ensure that the “Canonical URLs” checkbox is selected:

Canonical URLs

That’s all you need to do! If you view the source of one of your site’s pages, you will spot the following tag nestled near the top:

Canonical URL

The above code is the best way of informing Google what the canonical URL is for a specific page, and All in One SEO Pack will repeat this code for every page on your site.

More About Canonicalization

If you’re feeling particularly geeky (it’s okay — you’re amongst friends here) and would love to learn even more about canonicalization, check out this excellent video by Matt Cutts:

Creative Commons image courtesy of woodleywonderworks

Tags

Comments (14)

  1. The above tips are great, particularly about setting up a site properly with both www and non-www in Google Webmaster Tools. However, users don’t need a plugin like All in One SEO to add canonical tags to their site – it’s been a built-in feature of WordPress since version 2.9.

  2. Hi Tom,

    Glad I came across this page. I knew nothing about this stuff.One thing I do have trouble with every time is getting my websites verified for webmaster…not sure what I am doing wrong, but I never can seem to find out either..techically challenged at times.

  3. Great article. Question though: If you’ve been on Blogger and are now transferring over to WordPress, there are plugins to copy your content over. But if you still have both sites up during a transition period, do you run the risk of being hit for duplicate content? Is there any way to prevent that?

    • Hi Tema,

      I wouldn’t concern yourself with it too much. Google doesn’t penalize duplicate content, it prioritizes it. So worst case it sees your new site and doesn’t prioritize it over the Blogger site. And then when the Blogger site disappears, it should reconsider.

      If you’re really worried about it, just set your WordPress blog to “nofollow” until you have got rid of the Blogger blog.

      Cheers,

      Tom

  4. Hi:

    I am on 3. Set Canonical URLs for All Pages On Your Site and use Infinite SEO by WPMUDEV.

    I do not see a option to select:

    1. Canonical URL’s

    or

    2. Rewrite Titles

    What do I do in that case?

    :)

    Thank you very much for this. I hope it works. I have been trying to resolve this for some time now.

    Greg

  5. Oh, also, should this be done for the Bing and Google Verification Codes in Infinite SEO (I have already proven ownership and submitted them):

    Search engines

    Options related to direct interaction with search engines.
    Google site verification code
    No META tag will be added

    Bing site verification code
    No META tag will be added

    Automatically notify search engines when my sitemap updates Automatically notify search engines when my sitemap updates

    {check} Google
    {check} Bing

    Greg

Participate