If I was Google, I would ignore most of the older posts on a frequently-updated blog. So it's possible that you are wasting money on hosting if you are keeping all of the posts.
Here is the code for the WP plugin that I coded:
PHP Code:
function delete_old_posts()
{
global $wpdb;
$tokeep = 90;
$protected = array(1); // Array of protected post ID's
// Select the posts to be deleted
$rows = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE `post_status` = 'publish' AND `post_type` = 'post' ORDER BY ID DESC LIMIT $tokeep,1000000" );
foreach($rows as $row)
if (!in_array($row->ID, $protected))
wp_delete_post( $row->ID, true ); // Delete post and force deletion rather than trash it
}
add_action( 'publish_post', 'delete_old_posts' );
I ran this plugin on my blog for a few weeks now and it still ranks and maintained PR.
Bookmarks