can this be done with google adsense bot

Discussion in 'robots.txt' started by gdtechind, Nov 23, 2005.

  1. #1
    i want to do something which a few ppl might find odd, but i want to stop all the robots to visit my page, but the googlebot for Adsense only.
    i think it is called mediapartners googlebot, but am not sure about what should be robots.txt file for that :confused:

    any help is appreciated.

    thanks
     
    gdtechind, Nov 23, 2005 IP
  2. ozami

    ozami Peon

    Messages:
    89
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mediapartners-google <- thats the official name. Not sure what the command would be - need to read up on robots.txt commands
     
    ozami, Nov 23, 2005 IP
  3. EWpro

    EWpro Well-Known Member

    Messages:
    281
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    118
    #3
    User-agent: Robot_Name
    Disallow: /dir/

    replace Robot_Name with the exact bot name or use wildcard '*' for all.

    AFAIK there is no simple way to exclude all but one. You may need to create long list, for every robot except mediapartners-google.

    Find out what robots are visiting your sites from your server log and for each bot you want to block add like this:

    User-agent: Robot_Name
    Disallow: /
     
    EWpro, Nov 23, 2005 IP
  4. EWpro

    EWpro Well-Known Member

    Messages:
    281
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    118
    #4
    User-agent: *
    Disallow: /
    User-agent: mediapartners-google
    Disallow:

    The above should block all except mediapartners-google. But actually it fails and block all bots that obey robot.txt - including google! So it may not help your case.

    The one in my previous post is rather fool-proof.
     
    EWpro, Nov 23, 2005 IP
  5. gdtechind

    gdtechind Peon

    Messages:
    414
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hmm, you said it right, it blocks many other robots as well

    will use the earlier code

    thanks a lot
     
    gdtechind, Nov 23, 2005 IP
  6. elf98

    elf98 Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    your robots.txt should contain someting like this:
    First we match the mediapartners-google bot and disallows nothing.
    After we have matched the adsense bot we match any bot and disallows everything!
     
    elf98, Nov 23, 2005 IP
  7. jlawrence

    jlawrence Peon

    Messages:
    1,368
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    0
    #7
    elf98 is correct. Allow first then disallow everything else.
     
    jlawrence, Nov 23, 2005 IP
  8. gdtechind

    gdtechind Peon

    Messages:
    414
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    thanks a lot for that information

    it works well
    :D
     
    gdtechind, Nov 23, 2005 IP
  9. maro

    maro Peon

    Messages:
    356
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Do you mind me asking why are you doing this?
     
    maro, Nov 24, 2005 IP
  10. saqib_islam

    saqib_islam Peon

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I think that helps us so google can not find which website are we using adsense easily and if there is any violation of terms you might get another chance to get out of it
     
    saqib_islam, Jul 7, 2009 IP