10

I am using following robots.txt file for a site: Target is to allow googlebot and bingbot to access the site except the page /bedven/bedrijf/* and block all other bots from crawling the site.

User-agent: googlebot
Disallow: /bedven/bedrijf/*
Crawl-delay: 10

User-agent: google
Disallow: /bedven/bedrijf/*
Crawl-delay: 10

User-agent: bingbot
Disallow: /bedven/bedrijf/*
Crawl-delay: 10

User-agent: bing
Disallow: /bedven/bedrijf/*
Crawl-delay: 10

User-agent: *
Disallow: /

Does the last rule User-agent: * Disallow: / disallow all bots from crawling every pages on the site?

  • 11
    This whole task concerns me. There are other search engines, and anyone who uses them won't see your site. theeword.co.uk/info/search_engine_market says that 4.99% of the internet is not on your search engines. That's a lot of people. A better method would be to monitor your traffic and see if any bot actually causes issues, then block those specifically. – GKFX Jan 12 '15 at 19:22
  • 8
    A misbehaving bot could just totally ignore your robots.txt anyways – Nick T Jan 12 '15 at 21:13
  • 8
    Really bad bots don't care about robots.txt – Osvaldo Jan 12 '15 at 21:38
  • 4
    @NickT, in the real world, there are no shortage of poorly-behaved bots that follow robots.txt, or at least the Disallow: / rule. If your personal website is getting hammered into the ground because a bot programmer never considered that the server might be a Raspberry Pi on the wrong end of a 256 kbit connection, a blanket exclusion like this is useful. – Mark Jan 13 '15 at 5:31
  • 2
    @Console why? – o0'. Jan 13 '15 at 9:14
24

The last record (started by User-agent: *) will be followed by all polite bots that don’t identify themselves as "googlebot", "google", "bingbot" or "bing".
And yes, it means that they are not allowed to crawl anything.

You might want to omit the * in /bedven/bedrijf/*.
In the original robots.txt specification, * has no special meaning, it’s just a character like any other. So it would only disallow crawling of pages that literally have the character * in their URL.
While Google doesn’t follow the robots.txt specification in that regard, because they use * as a wildcard for "any sequence of characters", it’s not needed for them in this case: /bedven/bedrijf/* and /bedven/bedrijf/ would mean exactly the same: block all URLs whose path begins with /bedven/bedrijf/.

And finally, you could reduce your robots.txt to two records, because a record can have multiple User-agent lines:

User-agent: googlebot
User-agent: google
User-agent: bingbot
User-agent: bing
Disallow: /bedven/bedrijf/
Crawl-delay: 10

User-agent: *
Disallow: /
  • 5
    Note that Google ignores the crawl-delay directive in robots.txt. You have to set it in Google Webmaster Tools instead. – DisgruntledGoat Jan 13 '15 at 2:51
-2

Bots, especially bad ones, may ignore robots.txt file. So no matter what is written there some bots may crawl your site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.