Cleaning spam with phpMyAdmin

For those who use SpamKarma, this is hopefully irrelevant. But consider that this type of technique might be of use for other types of software (forums, other blogs), I’ll detail how you can clean your blog directly using phpMyAdmin.

Log in to phpMyAdmin.

Select the wordpress database -> Browse wp_comments -> Search

Check out screenshot

Then hopefully you’ve identified some things you can use to differentiate between spam and ham. In this case it’s a user agent I consider fake. You can then narrow the field more, if needed, such as putting in a domain used by spammers. In this case I entered hotmail, but it could just as well have been cashette.com. Another important thing, is that my blog differentiates between approved comments, comments deemed by a blacklist to be spam, and unapproved comments. By narrowing the search to only unapproved comments, there’s less risk I wipe out comments I want to keep. Notice also that I used the LIKE %…% when I only entered part of what could be in that field. Very important if you want to match the domain in an e-mail address, but not the username.

Once you’ve submitted your search, you can set the results to display more than 30 records per page, if you like. Then scroll to the bottom of the page (or look through the results to ensure no false positives have snuck in). Click on Check all, and then on the X, and then click to confirm to delete all those records.

There are ways to do this in straight SQL, but this is easier for most people.

Leave a Reply