| SEO for Paged Comments |
| Written by Lee Ng. |
| Tuesday, 02 February 2010 01:36 |
|
The paged comments feature new in WordPress 2.7 is handy for reducing page size, but it introduces the search engine optimization (SEO) problem of putting the same content on different permalinks, as some have pointed out. That’s because the complete post would appear at all of these permalinks:
My solution in this short plugin is to have all but the main permalink show an excerpt of the post, with a link back to the permalink page. http://www.pressedwords.com
*/
function seo_paged_comments_content_filter($t = '') {
if ( function_exists('get_query_var') ) {
$cpage = intval(get_query_var('cpage'));
if ( ! empty( $cpage ) ) {
remove_filter('the_content', 'seo_paged_comments_content_filter');
$t = get_the_excerpt();
$t .= sprintf('', get_permalink(), get_the_title());
}
}
return $t;
}
add_filter('the_content', 'seo_paged_comments_content_filter');
Installation:
|



This could be you!
Comments