Subscribe By RSS or Email

February 6, 2010

Quick: 1 Fantastic Way to Block Spam on a WordPress Blog




  • Buffer



  • Buffer

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.



Related Posts Plugin for WordPress, Blogger...

About the author, Derek Land

Derek has been designing & writing since childhood and more recently has designed & developed for international projects, as well as written for several digital magazines. He lives in New York with his family, two cats, and vintage Italian espresso maker. You should follow him on Twitter

  • http://davidwoodfx.blogspot.com/ David W.

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

On Twitter

We're teaming up with ThriveSolo for a giveaway! We have memberships for ThriveSolo Project Management - FREE. Watch this space for details