Forums

Fight Comment Spam (5 posts)

  1. Gemini6Ice
    Member
    Posted 7 years ago #

    I've been getting a lot of poker comment spam recently, and I cooked up a quick trick to fight it, so I thought I'd share:

    I.) In wp-comments-post.php, there are three or four calls to die(), which stop the comment from being posted if there is an error. Somewhere in the line of these, drop in:
    if ( commblist($user_ip) )
    die( __('Registered spambot! JERK!') );

    II.) For easy access, next turn to the file you edit most often, which should be index.php or index.html (etc.) for most of us.

    When you receive a spam comment, click on the ARIN WHOIS link and look for a line marked in the form of"NetRange: 194.0.0.0 - 194.255.255.255." This means that the spambot is operating within the 194.*.*.* block of IP addresses. Now you can easily block all comments coming from this block of IP addresses.

    function commblist($ipaddy)
    {
    $segs = explode('.',$ipaddy); // creates an array of the 4 blocks in the IP address.
    if($segs[0] == 194)
    return true; // $segs[0] refers to the first number in the IP address
    if(implode('.',$segs[0],$segs[1],$segs[2])=="192.6.143")
    return true; // to string multiple numbers back together, use implode('.',$segs[0]... however many you need). I used this line to block the IP block of 192.6.143.*
    return false;
    }

  2. Gemini6Ice
    Member
    Posted 7 years ago #

    Somebody changed the post title. Hehe, that amuses me. :)

  3. Ajay
    Member
    Posted 7 years ago #

    I use Spamminator and put online poker in the list of blocked words. Have blocked quite a few comments since.

  4. Mark (podz)
    Support Maven
    Posted 7 years ago #

  5. budiselich
    Member
    Posted 7 years ago #

    I have used blacklist. It also works great. I have a post written about fighting spam if you want more information. http://masonmd.blogspot.com/2004/10/building-your-own-blogsome-technical.html

    http://weblogtoolscollection.com/archives/2004/06/04/wpblacklist-121-released/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.