Delete Spam Daily

Version 1.0.2

View plugin at Delete Spam Daily 1.0.2
Direct Download here: Download ‘Delete Spam Daily 1.0.2′

This plugin schedules a daily event using wp_cron that deletes all comments marked “spam” in the database, then optimizes the database.

Brief reason why I made such a low-tech plugin:

Akismet catches all the spam, but when I was looking at the size of my backups one day, I noticed that there were large numbers of comment spam across several sites that were undeleted and they made the databases fairly large. So I setup a cron job on my server that deletes the spam.

Since I had never written a plugin, I thought this might be helpful for those who do not have a dedicated server, shell access to their site, or the knowledge of (or interest in ) cron to set this up.

Spam is not deleted until you start the schedule after the plugin is activated. I created buttons to start and stop the schedule if you need that layer of control. There is also a button for deleting all spam manually.


  • Version 1.0.2 – 5.28.09: Now optimizes the `wp_comments` table after spam is deleted. Updated DB call to allow for alternate wordpress table prefix.
  • Version 1.0.1 – 5.26.09: Minor update. `add_action` was added to the “Delete Spam Daily” button so it would actually delete spam once a day. :-) In addition to a “Stop Deleting Spam” button, a button was added that reschedules the cron to happen in 1 minute so you can be sure your crons are working right away.
  • Version 1.0 – 5.25.09: Initial Release. Included button to start deleting spam daily, and a button to delete spam immediately. Once the schedule was activated, it provided a button to stop the schedule. Shows current spam count and next scheduled delete.

If you have shell access to your server or have the ability to schedule cron jobs with your web host, you can schedule a cron job to accomplish this task. Read details here.

11 thoughts on “Delete Spam Daily

  1. Pingback: Anwyn’s Notes in the Margin » “Have You Got Anything Without Spam?”

  2. Pingback: The WordPress Plugins I Currently Have Loaded | Over The Road

  3. Pingback: Come prevenire e combattere lo spam su Wordpress | Pecciola

  4. Pingback: 15 Anti Spam Plugins for Wordpress Blogs | Photo Collection - Graphics Arts, Amazing Desings and more

  5. Pingback: 10 Essentials Wordpress Plugins to Fight Spam

  6. Pingback: Spams and all the Junk Comments | Archives

  7. Pingback: WordPress Blog Tips – Useful Plugins « Adventures of a Soon to be Business Owner

  8. Mike


    Thanks for this plugin.

    It’s a simple solution to a difficult issue. Every time I turn around, my spam folder has 50 comments in it…aarrgghh!!


  9. Pingback: 15 Anti Spam Plugins for WordPress Blogs | MêGái.Net

Comments are closed.