4 Jul

If your Wordpress site has been attacked by similar comments spamming tool, here’s what you can do to easily delete all Wordpress spam comments using phpMyAdmin and implement a simple CAPTCHA system to make the spammer’s life difficult.
Since the spam comments keeps in coming in, I had to do something to stop it first. Log in to your Wordpress Admin site, go to Settings > Discussion and CHECK “Users must be registered and logged in to comment“. Now the spam comments should stop since it requires an account. To be on the safe side, disable registration by going to Settings > General and UNCHECK “Anyone can register“.
When you’ve done both of the steps above, no comments will get in.
Now to clean up the spam that’s in moderation. Log in to phpMyAdmin, select the database that has Wordpress installed and go to SQL tab. Type the following command below and click the Go button.
delete from wp_comments where comment_approved = '0'

As you can see at the screenshot above, phpMyAdmin took less than 0.1 seconds to clean up 886 spam comments.
There are a few Wordpress plugins that can help you implement CAPTCHA in your comment form. As for me, I installed reCAPTCHA because other than preventing easy comment spamming, it also helps to digitize books, newspapers and old time radio shows. Simply download wp-reCAPTCHA, drop it in plugins folder and activate. Sign up for a free reCAPTCHA account to get public and private key. Enter both keys in your Wordrpess’ Settings > reCAPTCHA.
Finally you will need to allow your visitors to post comments. Go back to Settings > Discussion and UNCHECK “Users must be registered and logged in to comment“.
The spammer took hours to spam the comment form but it took me less than 1 second to clean up the spam and another 3 minutes to install reCAPTCHA in my comment form. Do the math and the spammer sure looks silly. reCAPTCHA is not impossible to crack but the spammers would have to spend even more of their precious time and effort to do something that they don’t even gain anything from it.
Technorati Tags: wordpress, comment, spam, recaptcha, phpmyadmin
: Copying this article to your website is strictly NOT allowed. However, if you like this article, you can use the HTML code below to directly link to this article.
Nasty Spam on Wordpress Comment box Reset Wordpress Admin User Password from phpMyAdmin How To Turn Off Comments For All Post In Wordpress Raymond.CC website inaccessible – Migration WP-DB Backup 1.7 directory traversal exploit Portable Local WebServer with Apache, SQL, PHP and Applications for Windows Find Out Who is Hosting Website With .CO.CC
Have computer technical problems? Get FREE help from Raymond.CC FORUM
20 Responses for "Easily Delete All Wordpress Spam Comments Using phpMyAdmin"
Great post Ray!
Great. Lesser spam more useful
I LOL’d
or as gamers say “pwnt”
Nice work quick actions save the rest of us from these little kids.its a shame they waste their time with these sort of things especially on this kind of site which is just informative and causing no problems anywhere.
shame on them and good on you ray.
Good on you Raymond. To all spammer of Raymond.cc blog – Get a life, bother some one that deserves it! I’m not gonna get political, but be cool, Raymond.cc is on the people’s side!
Nice trick there Ray.
Unfortunately, it’s those spammers that make it harder for those who actually enjoy your articles and want to comment easily. There are times when even ReCAPTCHA is hard to read for a actual people. I know there is a refresh button but it’s just an annoyance that I don’t like to deal with. Most of the time I’d rather just not post than have to deal with those silly things.
Oh well, with popularity comes annoying kids who have nothing better to do with their lives.
Good luck Raymond and thanks for the tip.
Thanks Ray! I am searching for a good Captcha plugin and luckily I found this article. Re-captcha is compatible upto 2.7.1. Are you this plugin? Are there any issues with it when using on WP 2.8? Because I have had some troubles with plugins on WP 2.8 and it takes lot of time to find the solution. Any suggestions?
Thanks for that Raymond. a very informative piece for someone like myself that is just starting out with Wordpress.
My PhPbb Forum is being targetted and is creating 20 User accounts per day. I have no idea what to do man.
Thanks ray, another great article as usual
, anyway steveo there are CAPTCHA additions on phpBB, just search their site for some. It should slow down the registration process on the spam. oh and disable accounts from the same e-mail and IP.
thanks, i had 1500 unread comments after a holiday. using php myadmin did the trick.
Gosh, this made my day. I installed Akismet on one of my sites running WP as a CMS quite late and now I have over 1,200 comments awaiting moderation. This makes me breathe easy again. Thanks for the tips!
Ray,
I’ve gone in and deleted over 29,000 spam comments by removing them from the database. But comment count on the sidebar still says I have 29000 comments to review.
Is there some other function of WordPress that calculates the comment count on the sidebar?
Thanks for the idea. I had a client with 7,000 spam comments. No way was I going to delete all of those by hand, plus the front-end timed out when trying to list more than 20 comments.
thanks a lot! i got 3000++ spam messages. now it all gone. thanks!
Thankyou verymuch ….. i have deleted 2328 spam pending comments !!!
Wordpress stores comment count in a separate field in the database for each post (that is an understandable way of optimizing the system, meaning that there is no need to count comments upon every page load), and automatically updates the comment count field on each new comment.
So, do not forget, that after deleting the comments like that manually from the database, you will have to manually update the appropriate comment count field in the database for each affected post, which might be a headache.
Good on you Buddy! That worked out like… SWEET!
Unlike others who’ve had the problem, I only had 2,100 spammin’ crammers on my site.
Thanks for sharing your brain cells with the rest of us!
EnK
nice trick, nice work
Leave a reply