How to ban or disallow some IP to show your adsense ads?

Discussion in 'AdSense' started by webmasterforums, Feb 23, 2010.

  1. #1
    Hi!
    I want to disallow some IP addresses ( of myself and of some known bots clicking rapidly on adsense ads).

    How can I do this ?

    And if i have a wordpress blog how can i do this?
     
    webmasterforums, Feb 23, 2010 IP
  2. livedr

    livedr Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    for you use a Firefox plugin to hide adsense ads
     
    livedr, Feb 23, 2010 IP
  3. pearlgurl

    pearlgurl Well-Known Member

    Messages:
    838
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    135
    #3
    He is asking for the visitors not for self.:D
     
    pearlgurl, Feb 23, 2010 IP
  4. Adpubster

    Adpubster Peon

    Messages:
    4,017
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Adpubster, Feb 23, 2010 IP
  5. Lex350

    Lex350 Notable Member

    Messages:
    1,889
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    215
    #5
    You can block the known bots in your ht access file. You can also block ips if you want.
     
    Lex350, Feb 23, 2010 IP
  6. webmasterforums

    webmasterforums Peon

    Messages:
    96
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    webmasterforums, Feb 23, 2010 IP
  7. hmfwebb

    hmfwebb Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Here is what you would add to your .htaccess to deny IP's:

    RewriteEngine On

    order allow,deny
    deny from 216.9.35.60
    deny from 174.133.146.18
    deny from 74.125.19.147
    allow from all
     
    hmfwebb, Feb 23, 2010 IP
  8. Adpubster

    Adpubster Peon

    Messages:
    4,017
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Note, though, that this blocks them so they can't see ANY of your site whereas the other method above lets them see your site but NOT the ads.
     
    Adpubster, Feb 23, 2010 IP
  9. hmfwebb

    hmfwebb Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    yep, this is a quick and easy fix that can be be implemented to every single site with a single edit, useful if you have dozens of domains, which means you don't need to mess with source code. I prefer this because I don't that bot/visitor on my website, period.
     
    hmfwebb, Feb 23, 2010 IP
  10. this_is_it

    this_is_it Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    it's a great tips.. i thought the only way to do it was to set it up on htaccess file..

    thanks, mate..
     
    this_is_it, Feb 23, 2010 IP
  11. webmasterforums

    webmasterforums Peon

    Messages:
    96
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Using this will block the whole site from getting displayed in the IP.

    And Actually I wanted to block my own IP address as my ISP provides same outgoing IP to every users and I got some clicks from my own Ip also as seen from my visitor tracking software!
     
    webmasterforums, Feb 24, 2010 IP
  12. bilalx

    bilalx Active Member

    Messages:
    427
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #12
    <?php
    $visitorIP = $_SERVER['REMOTE_ADDR'];
    $blockedips = array('123.45.', '123.56.', '123.67.67.');
    if (!in_array($visitorIP,$blockedips)) {
    ?>
    // adsense code here
    <?php
    }
    ?>
    HTML:
    use this method as earlier mention
     
    bilalx, Feb 24, 2010 IP
  13. hmfwebb

    hmfwebb Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Do you also know of a script that will stop adsense ads from showing if they've been click on say 3-4 times?
     
    hmfwebb, Feb 24, 2010 IP