Yoast: RT @idivenow: I just donated to @Yoast for his awesome plugins, you should too: http://t.co/7GTWe1rE <-- THX!!
![]()
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:
Basically I did a few things:
- I changed the title and breadcrumbs on subpages.
- I made the subpages display excerpts (the first 300 words) instead of the full post.
- 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(" "," "," ","&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!





by monchito on 18 April, 2007 at 15:23
nice :) will definately use this when i convert to wp :p
by André Scholten on 18 April, 2007 at 16:06
I noticed it some months ago and used exact the same solution. It works fine right now.
by Joost de Valk on 18 April, 2007 at 16:10
Funny :) Not http://andrescholten.nl/index.php/page/&hl=en&safe=off&filter=0">all your pages are indexed though...
by TruFu on 18 April, 2007 at 17:32
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.
by Rxbbx on 18 April, 2007 at 18:58
@Trufu
I also restrict urls with robots.txt. This looks good too.
by Joost de Valk on 18 April, 2007 at 20:09
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.
by SEO Egghead on 19 April, 2007 at 04:17
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.
by Joost de Valk on 19 April, 2007 at 07:30
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...
by Ruud Kok on 19 April, 2007 at 19:50
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" />'; }?>by Joost de Valk on 19 April, 2007 at 20:17
Hmm better than blocking them alltogether, but still you're blocking all subpages... I like my resolution more ;)
by Ruud Kok on 21 April, 2007 at 11:26
In my bookmarks I found this thread on WMW: http://www.webmasterworld.com/google/3097706.htm
by rxbbx on 22 April, 2007 at 15:35
better then blocking everything.. you guys are right. why focus on one solution when you can have it all..
Pingback: Rxbbx Dev Blog WordPress Supplemental Fix
Pingback: Server switch en overzicht met SEO artikelen. - chapter42
by Astrit on 15 May, 2007 at 20:07
Hello Joost,
Could you please explain where this code exactly should be put (not very friendly with technical words such as loop etc)
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.
by Astrit on 15 May, 2007 at 20:09
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
by Joost de Valk on 15 May, 2007 at 20:17
Hey Astrit: within the loop, which is the function which displays the post.
by Astrit on 16 May, 2007 at 03:01
Yeah figured it now. Thank you Joost, this was exactly what i was looking for. :)
Enjoint Netherland (or rather Amsterdam)
Pingback: Preventing duplicate content issues via robots.txt and .htaccess « Hamlet Batista — Internet entrepreneur, developer and search marketer
Pingback: Wordpress Supplemental Fix | Red Block
by TechDuke on 15 June, 2007 at 12:45
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.
by Joost de Valk on 15 June, 2007 at 12:48
Good stuff TechDuke :) thx!
Pingback: Preventing duplicate content issues via robots.txt and .htaccess at Hamlet Batista - Internet entrepreneur, developer and search marketer
Pingback: Google Search URL parameters -
Pingback: Weblog plugins » Sagavi
by Medical Transcriptionist on 28 November, 2007 at 15:21
Thanx Ruud Kok, I was in search of this meta tag.
by Daniel on 16 January, 2008 at 17:36
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
by Joost de Valk on 16 January, 2008 at 17:38
@Daniel: sharing meta descriptions is almost never a good idea, so I guess this would be a smart solution :).
by Daniel on 16 January, 2008 at 17:44
@Joost, Thanks for the speedy reply.
What if the solution is to leave the metatags for paged index pages blank?
by Joost de Valk on 16 January, 2008 at 18:02
@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.
by Neil on 14 February, 2008 at 07:41
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.