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/">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(" "," "," ","« Previous page","Next Page »","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!

Tags: ,


Yoast.com runs on the Genesis Framework

Genesis theme frameworkThe Genesis Framework empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides you with the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go.

Read our Genesis review or get Genesis now!

31 Responses

  1. monchitoBy monchito on 18 April, 2007

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

  2. André ScholtenBy André Scholten on 18 April, 2007

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

  3. Joost de ValkBy Joost de Valk on 18 April, 2007
  4. TruFuBy TruFu on 18 April, 2007

    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.

  5. RxbbxBy Rxbbx on 18 April, 2007

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

  6. Joost de ValkBy Joost de Valk on 18 April, 2007

    The advantage of this solution in my opinion is that it actually means “different” content will be indexed, allowing for other keyword matches. I actually see quite a bit of traffic coming to my category pages coming because of matching of two different keywords in two separate posts.

  7. SEO EggheadBy SEO Egghead on 19 April, 2007

    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.

  8. Joost de ValkBy Joost de Valk on 19 April, 2007

    Another advantage of this solution is that spiders will actually properly index your internal linking structure, which is lost if you block it from them…

  9. Ruud KokBy Ruud Kok on 19 April, 2007

    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" />';
    }?>
  10. Joost de ValkBy Joost de Valk on 19 April, 2007

    Hmm better than blocking them alltogether, but still you’re blocking all subpages… I like my resolution more ;)

  11. Ruud KokBy Ruud Kok on 21 April, 2007

    In my bookmarks I found this thread on WMW: http://www.webmasterworld.com/google/3097706.htm

  12. rxbbxBy rxbbx on 22 April, 2007

    better then blocking everything.. you guys are right. why focus on one solution when you can have it all..

  13. AstritBy Astrit on 15 May, 2007

    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.

  14. AstritBy Astrit on 15 May, 2007

    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

  15. Joost de ValkBy Joost de Valk on 15 May, 2007

    Hey Astrit: within the loop, which is the function which displays the post.

  16. AstritBy Astrit on 16 May, 2007

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

    Enjoint Netherland (or rather Amsterdam)

  17. TechDukeBy TechDuke on 15 June, 2007

    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.

  18. Joost de ValkBy Joost de Valk on 15 June, 2007

    Good stuff TechDuke :) thx!

  19. Medical TranscriptionistBy Medical Transcriptionist on 28 November, 2007

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

  20. DanielBy Daniel on 16 January, 2008

    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

  21. Joost de ValkBy Joost de Valk on 16 January, 2008

    @Daniel: sharing meta descriptions is almost never a good idea, so I guess this would be a smart solution :).

  22. DanielBy Daniel on 16 January, 2008

    @Joost, Thanks for the speedy reply.

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

  23. Joost de ValkBy Joost de Valk on 16 January, 2008

    @Daniel hmm I’d not display them at all… If you pass me the plugin at joost at this domain, I could easily hack that in for you.

  24. NeilBy Neil on 14 February, 2008

    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.

Trackbacks

  1. [...] WordPress subpages going supplemental: the fix. Good post from Joost de Valk. Another approach to fix WordPress subpages going supplemental with help from SEO Egghead, who released his SEO Book “Professional Search Engine Opimization with PHP” earlier this month. [...]

  2. [...] да избегнете попадането на Ñ?траниците в supplemental results WordPress subpages going supplemental: the fix и 3 WordPress Hacks For SE-Friendly Blog [...]