Block Spammers by IP address in WordPress

Posted: March 13th, 2009 | Author: jriggs | Filed under: wordpress | 1 Comment »

Sooner or later you’re going to have a bot relentlessly pinging your site and posting comments that link to undesirable sites.  Fortunately, stopping these tpyes from accessing the site is easy.
1) If it’s not already there, create a file named .htaccess in the root directory of your blog.

2) Add the following text:

order allow,deny
deny from 213.163.65.27
deny from 213.163.65.73
allow from all

3) As you receive new spam posts, add a new line to this file containing the offender’s ip address.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • StumbleUpon

Related posts:

  1. Create Blank Page for WordPress Blog Using Your Theme Template
  2. Detect Adblock Users on a WordPress Blog
  3. Address Standardization & Verification with USPS web tools and PHP

One Comment on “Block Spammers by IP address in WordPress”

  1. 1 billd said at 5:20 pm on March 30th, 2009:

    you should mention that this only works for apache