WordPress Extend Akismet Spam Delete Time

Akismet, by default, deletes spam after 15 days. This may be fine most people, but I use my spam to control and deny new bots from my site. I cannot use this input when Akismet simply deletes it after the default 15 days. I often times am busier than that.

Here’s a 2016 post on how to extend this 15 day time limit.

You can change the number of days Akismet should keep spam comments in your database. Simply add this code to your theme’s functions.php file or in a site-specific plugin.

add_filter( ‘akismet_delete_comment_interval’, ‘custom_spam_delete_interval’ );

function custom_spam_delete_interval() {
return 7;
}

I changed the 7 to 60.

Wordpress Akismet anti-spam plugin, extend the purge date for spam from 15 to 60

WordPress Akismet anti-spam plugin, extend the purge date for spam from 15 to 60

It seems to work. I have a backup copy of my theme’s functions.php, just in case.

Leave a Reply

Your email address will not be published. Required fields are marked *