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.

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:



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