How to Change Akismet Delete Spam Schedule in WordPress

Akismet deletes the SPAM comments automatically every 15 days and if your site is receiving huge SPAM comments this might increase the DB size slightly. So How to Change Akismet Delete SPAM schedule in WordPress?

Many of the WordPress sites will be flooded with the SPAM comments and to protect the SPAM bloggers do install a popular plugin Akismet which protects from SPAM comments it also provides you the option to moderate the SPAM comment where you can mark it as Not Spam or Delete Permanently or Empty all the SPAM.

How to Change Akismet Delete Spam Schedule in WordPress

How to Change Akismet Delete Spam Schedule in WordPress

Why should you change the SPAM schedule of Akismet in WordPress?

  • Akismet tracks all the SPAM comments, Trackbacks, Pingbacks in the WordPress.
  • Even though Akismet marks it is a SPAM the comment will reside in your Database and it will increase the size of the DB.
  • If you are taking a daily backup of your Database then the backup size will be increased.
  • There will be a small improvement in the performance of the Database. Note: only if you are getting huge SPAM comments it may impact the performance slightly.
  • If you are getting 1000’s of SPAM comments every day then you might need more time to review every comment to make sure if there are genuine comments or it might be false positive from Akismet side.

Recommended Article to read

How to Change Akismet Delete Spam Schedule in WordPress

Akismet default settings keep the SPAM comments for 15 days so that users can review the comment before it automatically deletes it.

In case if there are any false positive then you could go to SPAM and mark it as NOT SPAM. By doing this Akismet’s algorithm will be tweaked to catch the SPAM comments effectively.
Changing Spam Comment Delete Schedule in WordPress with Akismet
If you would like to change the SPAM delete schedule of Akismet all you need to do is to add few lines of code in the theme’s function.php file.

The number 7 indicates to delete all the SPAM comments every 7 days . This filter modifies the SPAM schedule to given number of days.

In case if you need to change the Schedule to 30 days then replace the number from 7 to 30 and save the functions.php file to see it in action.

Alternatively, you can Login to Dashboard and navigate to Settings » Akismet page. At the bottom of the page, you should be able to see the note which says ‘Spam in the spam folder older than 7 days is deleted automatically.’


  • SPAM comments deleted will not go to trash and once it is deleted it cannot be recovered at all. So change the schedule according to your requirement.
  • If you are a PHP developer or doesn’t have knowledge on coding then make a backup of the file before you add/edit the code.

You may also like...

1 Response

  1. Gail says:

    It’s an awesome piece of writing in support of all the internet users; they will take advantage from it I am sure.

Leave a Reply

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

CommentLuv badge