Comment Spam

Bulk Delete WordPress Comment Spam

I notice a lot of my newly built client’s wordpress sites seem to be attracting a lot of comment spam quickly, even though they might not be blogging regularly. It’s not uncommon to see hundreds or even thousands of unapproved comments listed within months of going live. One site has only been up a few weeks and already attracted nearly 8,000 spam comments.

Trying to delete or process these comments in bulk is not supported very well in current wordpress versions as you can only show a max of 999 comments on a page so it leaves you going through pages and pages of unapproved comments. Until wordpress provides a simple “Delete all unapproved comments” or similar button, here’s a quick way of processing more than 999 comments at once.

It requires hosting and database/phpMyAdmin access so it’s not for the faint hearted but it only takes a couple of minutes. Backup your database first, then run one of these SQL commands:

DELETE FROM wp_comments WHERE comment_approved = "spam";


DELETE FROM wp_comments WHERE comment_approved = "0";


DELETE FROM wp_comments WHERE comment_type = "spam";

And you’re done.

It might be wise to install a spam filter to avoid these comment build ups in the first place. Akismet or SI Captcha for WordPress are good.


Published by

Leon Quinn

Multimedia Design company in Leitrim, Ireland specializing in WordPress Website Design, Photoshop and Graphics.

3 thoughts on “Bulk Delete WordPress Comment Spam”

  1. Hi Leon, very interesting advice (as always), I had that problem and did not immediately realise I could change the screen options.  I went with Akismet and have not looked back.  I helped my sister set up a small blog and we installed the free personal use Akismet and all her spam has been caught.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.