As you probably know this blog hasn’t really been doing anything for some time now. As such, there are exactly 78,445 comments awaiting moderation, and I am certain that they are all spam.
So I can just delete them all right? Sure, wordpress allows you to remove comments 25 at a time, so it will take a small team to get this one by the end of the month.
I deleted the comments straight out of the database in just a few seconds, and here is how I did it.
First, I made a backup of the database.
Following that, I went into phpmyadmin, selected the database wordpress is using, and hit the SQL tab.
I than check in the wordpress admin panel how many comments were pending, than ran the following command in the SQL section of phpmyadmin
SELECT *FROM wp_comments WHERE comment_approved =”0″
This this will output a number. Make sure this is the exact same number as the amount of pending comments you have in the wordpress admin panel. It should be. If it isn’t you have some serious problems which I can’t help you with.
Now that we have isolated the pending comments, time to delete them all. Go back into the SQL section and enter this command
delete from wp_comments WHERE comment_approved =”0″
This will delete all of these entries from the database directly.
You are done. Go back into the wordpress admin and make sure that the pending comments are gone. Your next step, is to install a better wordpress spam plugin like Akismet.