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!



nice :) will definately use this when i convert to wp :p
I noticed it some months ago and used exact the same solution. It works fine right now.
Funny :) Not all your pages are indexed though…
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.
@Trufu
I also restrict urls with robots.txt. This looks good too.
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.
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.
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…
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" />'; }?>Hmm better than blocking them alltogether, but still you’re blocking all subpages… I like my resolution more ;)
In my bookmarks I found this thread on WMW: http://www.webmasterworld.com/google/3097706.htm
better then blocking everything.. you guys are right. why focus on one solution when you can have it all..
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.
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
Hey Astrit: within the loop, which is the function which displays the post.
Yeah figured it now. Thank you Joost, this was exactly what i was looking for. :)
Enjoint Netherland (or rather Amsterdam)
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.
Good stuff TechDuke :) thx!
Thanx Ruud Kok, I was in search of this meta tag.
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
@Daniel: sharing meta descriptions is almost never a good idea, so I guess this would be a smart solution :).
@Joost, Thanks for the speedy reply.
What if the solution is to leave the metatags for paged index pages blank?
@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.
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.