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

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 thoughts on “HowTo: Mark a large number of comments as spam in WordPress

  1. Pingback: George Files » I get loads of spam

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>