Quick: 1 Fantastic Way to Block Spam on a Wordpress Blog
1 comment |ThisIsInspired has been getting plugged with spam galore. Granted, we have Akismet installed and it prevents and sorts most of the spam that comes our way — but there’s an even more root way to prevent spammers from sending their junk in the first place.
Via IP Address
If you Bing* “block ip wordpress” you’ll find this easy enough but it’s worth sharing again for the sake of posterity (and to save you a few minutes of going and Binging [sic] in the first place and sifting through the results.)
Using Coda or Textmate (or even TextEdit or Notepad) open the .htaccess file on your server. If you’re using Transmit or some other FTP client that hides hidden files, you’ll have to un-hide them first; .htaccess is a hidden file.
Insert this little tidbit of code: (yes, these IP numbers are actual spammers, so if you want to copy them feel free)
order allow,deny deny from 150.254.161.3 deny from 221.214.27.253 deny from 207.44.255.162 deny from 93.62.4.207 deny from 74.118.192.14 allow from all
Enter deny from and then the IP number. You’ll have to do this for each IP you wish to block.
Wildcards
If you, as with me, have discovered that Spam Galore has set up camp in a consistent subnet (eg: 256.256.whatever.whatever), you can use wildcards to block everything from one subnet on down the line. So in this instance, using a wildcard, we’d go:
256.256.*.*
Just remember to put on asterisk in place of whatever singular number (between the periods). This matches any number.
Only use this if you are really, really sure you want to block an entire subnet of addresses. You don’t want to block legitimate people from reading your blog.
* As you can tell, I don’t use Google unless absolutely required.




Wow, that’s a great tip, thanks for sharing TII!