Mark asked: How to batch deleting spam comments on a WordPress blog?

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:
Batch deleting spam comments on a WordPress blog

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!

21 Responses

Oct 10 2008 12:59

Thanks a lot Jean, it worked like a charm!

Oct 10 2008 14:44

Glad it helped!

Dec 12 2008 05:46

Oh thank god, I had one of my websites hacked via a plugin, forgot to reinstall Akismet, and was trying to figure out how to delete 32k spam comments. You’re a lifesaver!

Jan 03 2009 13:39

great, there’s bunch of comment in my blog

Jan 05 2009 18:29

WordPress 2.7 now has cool native “Delete all spam” button.

Feb 05 2009 04:55

Worked perfect!

Jun 16 2009 07:44

I’m using a different template, so I think that is why this cannot be done.. i came up with the following:

Deleted rows: 0 (Query took 0.0003 sec)

Hmmm.. why?
I using a review type of theme.

Any other methods?

Jun 16 2009 08:26

Got it solved.. My bad.. :) Choose the wrong database with nil comments.. sql is not that bad after all, NOT SO SCARY as i thought. Easy peasy.. :)

http://www.drostdesigns.com/how-to-mass-delete-comments-from-wordpress-using-phpmyadmin/#comment-333095

MORE COMPLETE INFO….

Sep 30 2009 16:37

Generally I do not post on blogs, but I would like to say that this post really forced me to do so, Excellent post!

Oct 09 2009 02:22

I don’t know If I said it already but …Hey good stuff…keep up the good work! :) I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your blog. Thanks,)

A definite great read….

Jan 23 2010 08:50

Fantastic! Thanks!

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required