Subscribe to the RSS Feed »

Follow me on Twitter »



Find Programming Jobs

WordPress anti-spam hack

I'm not yet sure how effective this is, but I just noticed that DreamHost's 1-click install of WordPress includes a hack that they claim helps protect your blog against comments spam. The added code is contained at the top of the wp-comments-post.php file:

if (!$_SERVER['HTTP_REFERER'] == dirname(__FILE__) . '/wp-comments.php')
{
    die ('Error: This file cannot be used on its own.');
}

This simply checks to see if the user (or bot!) arrived from the wp-comments.php file. If so, the comment is accepted. If not, the error message is displayed. I will try adding this to some of my bot magnet sites to see if it reduces the spam that Spam Karma has to deal with.

Speaking of Spam Karma, has anyone looked into the MySQL errors in that plugin? I can't flush the SK2 database table with SQL errors.

Share this: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Sphinn
  • StumbleUpon
  • TwitThis
  • del.icio.us
  • bodytext
  • Technorati
  • Pownce
  • description

Leave a Reply