1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

HELP! Static IP spamming my Wordpress blog, how can I block? I need a PHP script.

Discussion in 'HTML & Website Design' started by lsuchik, Oct 7, 2008.

  1. #1
    Hi everyone!

    I am having a problem with a bot that is spamming my blog comments tons through a static ip address on a daily basis. :( My blog is through Wordpress. I do have it set for this static ip to be put in the spam bin anything its posts which does work, but I would also like to block this static IP from even accessing my site. I am using php, not htaccess as it is not supported through my web hosting. Anyone have a php script that blocks static ips? I do have a script but it only block regular ip addresses.

    Here is the script I am currently using:

    <?php
    $deny = array("88.198.53.43", "static.88-198-53-43.clients.your-server.de");
    if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) {
    header("location: http://www.google.com/");
    exit();
    } ?>


    As you can see, I entered the troublemaker's ip and static ip in the script, but it isn't blocking them from my site, any suggestions please? I am a U.S. site, I would consider blocking all of .de ips if you know how to do that too.
    SEMrush
    Thanks in advance!
     
    lsuchik, Oct 7, 2008 IP
    SEMrush
  2. wisdomtool

    wisdomtool Moderator Staff

    Messages:
    15,808
    Likes Received:
    1,362
    Best Answers:
    1
    Trophy Points:
    455
    #2
    The easiest way is to complain to your web hosting provider and have them block this static IP through IP tables.
     
    wisdomtool, Oct 7, 2008 IP
    pipes likes this.
  3. Ikki

    Ikki Peon

    Messages:
    475
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think that .htaccess is best suited for this task. Try this.

    Hope that helps.
     
    Ikki, Oct 7, 2008 IP
  4. tomksoft

    tomksoft Well-Known Member

    Messages:
    2,281
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    175
    #4
    If you have hosting with cPanel, you can use IP Deny Manager and just block this IP from accessing all your websites(easiest and safetests).
    Next thing I can suggest you is to install SpamKarma plugin for wordpress, as it has it's own IP blacklist for comments.
     
    tomksoft, Oct 7, 2008 IP
  5. lsuchik

    lsuchik Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the replies! I went to my cPanel and found an option to block ips. I added the ip address, I hope it covers the full static address too. I hope it works! I will know soon when they try to repost. Thanks for the tips!
     
    lsuchik, Oct 7, 2008 IP
  6. yantomulia

    yantomulia Peon

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    if you using wordpress just install askimet plugins it really help.
     
    yantomulia, Oct 7, 2008 IP