WordPress subpages going supplemental: the fix

I noticed that the subpages for my blog (you can find links to them in the footer of this page), were all going supplemental. This wasn't really surprising as those subpages were displaying exactly the same as the frontpage: 5 full posts and a "next" and "previous" link to the next pages. This meant that page 32 was a full 32 clicks away from the blog frontpage...

Looking around if other people had the same problem, I noticed that Jaimie didn't... He had posted about these issues a while ago:

  1. Stop SEO Death By Pagination
  2. 3 WordPress Hacks For SE-Friendly Blog Archives

Basically I did a few things:

  1. I changed the title and breadcrumbs on subpages.
  2. I made the subpages display excerpts (the first 300 words) instead of the full post.
  3. I changed the pagination using Jaimie's pagerfix plugin which he was kind enough to update for WordPress 2.1.

1. Changing the title tag and breadcrumbs.

I used the following code in header.php to make sure the title reflects the page you're on:

if (is_home() ) {
	bloginfo('name');
	if (get_query_var('paged') > 1) {
		echo ' - Page ' . get_query_var('paged');
	}
}

Of course you can adjust your template to make the title display right for you.
In my index.php I added the following for the breadcrumbs:

<div id="breadcrumbs"> <a href="/">Home</a>
< ?php
	if (is_home() && get_query_var('paged') > 1) {
		echo '/ <a href="http://yoast.com/blog/">SEO Blog</a> / ';
		echo 'Page ' . get_query_var('paged');
	} else {
		echo ' / SEO Blog ';
	}
?>
</div>

2. Changing the subpages to display excerpts

I added the following into the loop for posts to make them display excerpts on the subpages:

< ?php if (is_home() && (!$paged || $paged == 1) || is_search()
 || is_single() || is_page()) {
	the_content('Read the rest of this entry »');
} else {
?>
<p>
  Archived; click post title to view the full post.<br />
  <br />
  <strong>Excerpt:</strong> < ?= substr(strip_tags($post->post_content), 0, 300); ?>
  <a href="<?php the_permalink() ?>">…</a>;
</p>
< ?php } ?>

I've done this for my archive pages as well, as I want my post pages to rank higher.

3. Changing the pagination

The last thing I did was installing Jaimie's pagerfix plugin, and calling it in the template with the following code:

pager_fix(" "," "," ","&laquo; Previous page","Next Page &raquo;","strong");

Jaimie covers a lot of this in his book on PHP and SEO, which you should definitly go get if you're doing a lot of this stuff!

24 Responses to “WordPress subpages going supplemental: the fix”

  1. nice :) will definately use this when i convert to wp :p

  2. I noticed it some months ago and used exact the same solution. It works fine right now.

  3. Hmm, interesting. I had a different look at this problem. What I did is restricting URLs where duplicate content was situated. On WP blogs, that is /category/, /feed/ and /page/ (I use full feeds, no excerpts). It seems te be working, my supplementals did decreases. This way, all the focus is on the individual pages.

    A few pages still hit supplemental, but a internal link to that post does the magic.

    I guess there are more roads that lead to Rome.

  4. @Trufu
    I also restrict urls with robots.txt. This looks good too.

  5. I'm on Joost's side, obviously ;) I updated PagerFix for WP 2.1 when Joost mentioned he wanted to make the changes I blogged about awhile back.

    I highly recommend everyone make these changes to WP. It doesn't sacrifice usability, while reducing duplicate content substantially.

    J.

  6. I'm using the following code to avoid duplicate content to be indexed but
    still remain search engines to follow link structures:

    <?php if (is_home() && ($paged <= "1") || is_single() || is_page() ||
    is_category() ) {
    	echo '<meta name="robots" content="index,follow" />';
    }
    else
    {
    	echo '<meta name="robots" content="noindex,follow" />';
    }?>
  7. better then blocking everything.. you guys are right. why focus on one solution when you can have it all..

  8. Hello Joost,
    Could you please explain where this code exactly should be put (not very friendly with technical words such as loop etc)

    Archived; click post title to view the full post.

    Excerpt: post_content), 0, 300); ?>
    ">…

    I liked your idea and thought this would be the best solution for preventing duplicated content being indexed in Google. I just can't figure where that code should be placed.

    Thank you.

  9. Apologies, that is just half of code, what i had pasted (but did not displaied for some reason) was your full code for 2. Changing the subpages to display excerpts

  10. Yeah figured it now. Thank you Joost, this was exactly what i was looking for. :)

    Enjoint Netherland (or rather Amsterdam)

  11. For some reason, I couldn't run this plugin on my site. It was giving some sort of MySQL error.
    After doing some search, I found this plugin http://www.lesterchan.net/wordpress/readme/wp-pagenavi.html , and it works perfectly fine. For those having problems with this method can use the plugin I mentioned.

  12. Thanx Ruud Kok, I was in search of this meta tag.

  13. Hi Joost,
    I've been trying to do some SEO housecleaning on my site and implemented Lester's pagination plugin and an SEO plugin for meta keywords and meta descriptions.

    The plugin that I chose for metatag generation is implemented in a way that deliberately does not generate meta keywords or meta descriptions for paged index pages (2...15).

    Any thoughts on whether paged index pages (so long as they contain excerpts and not full text of posts) should share meta keywords and meta descriptions with the index page?
    Thanks,
    Daniel

  14. @Joost, Thanks for the speedy reply.

    What if the solution is to leave the metatags for paged index pages blank?

  15. Does anyone know how to list sub-pages in a multi-column, I mean I dont want to spend the time learning the api of wordpress when I just need a simple multi-column sub-page list.

Comments closed, if you feel you have something to say:
drop me a line.

7 Trackbacks to “WordPress subpages going supplemental: the fix”

  1. Rxbbx Dev Blog WordPress Supplemental Fix - Sun, April 22nd, 2007 at 17:27
  2. Wordpress Supplemental Fix | Red Block - Mon, June 11th, 2007 at 02:36
  3. Google Search URL parameters - - Fri, July 6th, 2007 at 22:04
  4. Weblog plugins » Sagavi - Tue, August 21st, 2007 at 08:30