Update 2011-04-03: Reformatted .htaccess config lines now that I know how to do better formatting.
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:
deny from 220.127.116.11
deny from 18.104.22.168
deny from ...
allow from all
You can put as many “deny from 22.214.171.124” lines as you like.