George FilesThe truth, one post at a time

HowTo: Mark a large number of comments as spam in Wordpress

May 25, 2007 by roshan.george in Internet

Taking a cue from bindanaku here I finally got rid of all the spam filling up my moderation queue. Now the search begins for how to block a particular phrase.

This is the MySql query I used. I had to go to CPanel and then find phpmyadmin. From there it's obvious where to type this in.
UPDATE `wp_comments` SET `comment_approved` = 'spam' WHERE `wp_comments`.`comment_approved` ='0' LIMIT 5

Or if you're particular about which IPs you want to ban:
UPDATE `wp_comments` SET `comment_approved` = 'spam' WHERE `wp_comments`.`comment_approved`='0' AND `wp_comments`.`comment_author_IP` LIKE '62.213%'

If you want to delete stuff, use: DELETE from `wp_comments` WHERE [your conditions]

Naturally, one changes the limit to the number of spam messages. The reason this needs to be done is that the moderation page refuses to open past 6000 in the queue or so. I had 16,900 when I finally managed to get rid of them. Yes, I have Akismet installed and no, I won't install Captcha codes, people hate filling in captcha codes and the few comments I have may dissappear.

9 comments

MarcMay 25, 2007

Just implement a simple CAPTCHA.

There was one I encountered some time ago that asked a simple mathematical question.

roshan.georgeMay 26, 2007

People hate captchas Marc. I want some comments atleast.

MarcMay 26, 2007

A simple numerical one. What is 1+2?

roshan.georgeMay 26, 2007

Then Chetan won't be able to post.

MarcMay 26, 2007

Not everyone is a mathematical genius like you.

Arun MMay 26, 2007

GEEKY stuff ! Im not able to get one word of it

roshan.georgeMay 27, 2007

Quite naturally, it's not like everyone knows the advanced math necessary to do that.

George Files » I get loads of spam (pingback)October 31, 2007

[...] If it’s too late and you’ve ended up in this situation, you can try marking them all as spam using phpmyadmin and sql. [...]

IdetrorceDecember 16, 2007

very interesting, but I don't agree with you
Idetrorce