Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a WordPress blog that I am hosting using Recently, Russians found it and have been comment spamming me. I don't want to have to trash 30+ Cyrillic comments/day, and I don't want to pay for that bandwidth either.

I did a little research, and all the commentors are originating from RIPE delegated IP ranges. Because my blog can only interest people living in the American Southeast, I figured the quick and dirty solution would be to use .htaccess to deny connections coming from and - I wrote a .htaccess file that did just this, but the Russians were still getting through!

According to's FAQ, they can't support IP blocking through .htaccess (dirt cheap hosting comes with a price). I can block comments by IP through Wordpress (I think), but I can't figure out a way to block IP ranges or wildcards.

Does anybody know of any other way?

share|improve this question
up vote 2 down vote accepted

Are you using the akismet plugin? This deals with comment spam quite efficiently

share|improve this answer
Would also highly recommend a reCaptcha plugin for comments. – squillman Mar 17 '10 at 16:07
Not using akismet yet. I'm reading about it now. Thanks! – Chris Mar 17 '10 at 16:12
Just a note that Akismet won't resolve the "I don't want to pay for that bandwidth either" issue - it'll actually involve more bandwidth, as your site has to communicate with Akismet each time a post is submitted. Still, it's well worth it - bandwidth is cheap. – ceejayoz Mar 17 '10 at 16:39
Just so you know, the ID of this post is 123456. Congratulations! – Andreas Bonini Mar 17 '10 at 17:31
I've been spam free for a day now. Akismet worked! Thanks! – Chris Mar 18 '10 at 12:43

You should really use a plugin that can prevent comment spam, if you block Russia you will just get spam from somewhere else. Blocking countries via IP address is not really effective either, not all net blocks we're geographically distributed. I bet you can find some north American networks that have net blocks assigned to other countries.

You'll also so forget your doing filtering in a years time , you'll be on holiday in Russia one day and you'll ask again why you can't access your blog from Russia ;-).

Captcha's are effective, also look at things like openid (which this sites uses!).

Again something like mod_security can be configured to prevent spam bots, it takes time and effort to get right, but sometimes worth it if your experiencing high server load or massive bandwidth consumption from spammers.

share|improve this answer

Read :Jay's PHP Form to Email with Anti-Spam Features Mike

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.