Mark just asked me how can he delete more than 6000 spam comments he received on his blog during his holidays.
Mark just asked me how can he delete more than 6000 spam comments he received on his blog during his holidays.
First of it all, backup your WordPress database. Then, login to your phpmyadmin, select your WordPress blog database and click on SQL:

Then, insert the following sql command:
DELETE from wp_comments WHERE comment_approved = '0';
All non-approved comments we be deleted. But instead of having such trouble next time, you should definitely install Akismet!
3 Responses
How can I delete all the comments? I have 400,000 spam comments which are approved.
Help
Hi there,
This is the clearest post I’ve read about this problem, so thanks. Do you know if there is a way of deleting spam comments that have been marked ‘approved’ without deleting my legitimate comments, which are also marked ‘approved’?
Ryan
How about the table called “wp_commentmeta”? That one has also data concerning the comments. Does it mess up the database (or at least leave a lot of unneeded data) if that table is untouched? I’d say that touching only the wp_comments table is not a proper way to handle the spam, unless the identical id-values are cleaner from the wp_commentmeta table.
I’d love to see a simple solution for that…
Also, I got 3 installation of multisite-wordpress’ and each blog in each wordpress has it’s own spam-comments. I’d love even more to see a plugin/tool to clean ALL those sub-blogs in a single stroke
@Kaira: check out similar post here, which shows howto delete all comments at once: http://techfreakz.com/itwebsites/content-management/wordpress/cleaning-up-wordpress-comments-mass-deleting-wordpress-spam-comments-mass-deleting-wordpress-comments/
Trackbacks: