I use Akismet on my blog and it catches 99% of all spam comments. However lately I noticed I get more than 2000 spam messages and I decided I’d rather ban those IPs. Chances are they are virus infected or zombie machines that potentially not only leave spam messages, but may also engage into other activities.

Before cleaning my spam comments, I first obtain a list of all those IPs from the wordpress table stored in my SQL server:

SELECT DISTINCT `comment_author_IP` FROM `wp_comments` WHERE `comment_approved` = "spam" ORDER BY `comment_author_IP` DESC

I then add those on to my firewall rules to block those IPs completely. Of course there can be proxies of large networks on the list, I know, which may in turn prevent legitimate users from accessing this blog, but lets see if my spam goes down.

Another way people may find useful is to ban them only on their blog using a plugin. One that works pretty well for this purpose is WP Ban

0