blog All the latest up to the minute
industry news and views

WordPress Default Canonical Issue And How To Avoid It

5th March 2012 |  Written by Dave Ashworth

Recently, when setting up a new site on the WordPress platform, we noticed a potentially very serious issue with regards default use of the canonical rel=’next’ and rel=’prev’ tags.

The issue arises when you create a series of site pages.  The default setting sees the rel=’next’ and rel=’prev’ applied to pages in the order they are created.

So on your home page, you may see:

<rel ="next" href="http://www.yourdomain.com/page-2" />

Then on the next page:

<rel ="prev" href="http://www.yourdomain.com/" />
<rel ="next" href="http://www.yourdomain.com/page-3" />

And so on. The reason why these were added were apparently for users with disabilities to give them easier access when navigating a sites content, they have been default since WordPress 2.9.

This conflicts greatly with how Google perceive the use of the canonical tag:

They are an issue because the next/prev tags are being adopted to solve pagination issues, particularly prevalent on ecommerce sites where category pages may contain several pages of similar content, for example:

http://www.yourdomain.com/category

http://www.yourdomain.com/category/page-2

http://www.yourdomain.com/category/page-3

The tag allows you to let Google know that the main page here is the first one, and that whilst each page may attract it’s own links, anchor texts, etc – the focus should be consolidated to the main page and be the one shown in the SERPs etc.

This works fine on ecommerce sites and the like, but if you took an existing site with, for example, 10 pages each with their own unique content and created in WordPress – all 10 pages would be default be “canoicalised” to the home page potentially losing rankings on sub pages that target specific terms.

To avoid this, place the following code in your themes functions.php script:

remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );

2 Responses to WordPress Default Canonical Issue And How To Avoid It

  1. Sidharth says:

    Hi Dave,

    Great article. Cleared a lot of confusion I had, but I have another question:

    I use Yoast SEO plugin. I figured out a way to get rid of the canonicalized tag completely, but it automatically adds “noindex,follow” to page/2/… page/3/, etc.

    It also comes with an option to add “noindex,follow” to tag/page/2/… and category/page/2/…

    Do you recommend this?

  2. Hi Sidharth,

    I would definitely recommended that tag on those pages – basically, you could have any number of pages / tags / categories which will continue to increase as you add content to your blog – depending on how these are optimised, you are potentially creating pages of duplicate content so far as title tags are concerned. By adding that tag, the multiple pages will not get indexed, but you will still allow the pages to be crawled so that the individual posts are accessible.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Manchester

Return On Digital,
Ground Floor,
The Tower,
Deva Centre,
Trinity Way,

Manchester,
M3 7BF


Telephone: 0845 86 22 122
Email:

Download our vCard

London

Return On Digital,
85 Tottenham Court Road,
London,
W1T 4TQ

Adwords Certified Partner