By default, Akismet deletes old comments marked as “spam” after 15 days. After few minutes of tinkering, I’ve made a small modification to the source code that let’s you define your own number of days.
Download
- Browse Akismet for WordPress SVN repository (right click and Save As)
This is the my custom modification based on Akismet version 1.2.1 (revision 6976)
You can configure the number of days before old spam comments to be deleted from Spam Deletion under Plugins→ Akismet Configuration.
Do It Yourself
Optionally, you can edit the value by editing akismet.php file. Open akismet.php, find:
$wpdb->query("DELETE FROM $wpdb->comments WHERE DATE_SUB('$now_gmt', INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'");
under akismet_delete_old() function and replace the number 15 with your own custom value.
umm , great! thank you..