Update 2011-04-03: Reformatted .htaccess config lines now that I know how to do better formatting.
Word to the wise: If you’re getting comment spam try WordPress‘ IP blacklist feature but, when that doesn’t work, try the guaranteed way: .htaccess.
I get a lot of spam on this blog, mainly to one post that got a lot of links. Akismet is great at detecting this spam and not publishing the comment. But it gets tiring removing comments from the same IPs all the time. So, I tried WordPress’ IP blacklist feature but it didn’t work. For some reason I totally forgot about .htaccess. It’s the fail safe mechanism for protecting your site against IPs that abuse your blog.
Just put a file named .htaccess in your blog directory if you’re running apache. If you’re running some other httpd server, sorry you’llĀ have to find another way. But, if you can do .htaccess you can do this:
order allow,deny deny from 188.92.75.82 deny from 91.214.44.182 deny from ... allow from all
You can put as many “deny from 123.123.123.123” lines as you like.