Skip to content

How to limit bots with robots.txt

Many search engine crawlers and bots, such as Googlebot, respect a robots.txt file in the root directory of your website. The robots.txt file instructs search engine crawlers or other bots which pages or files to crawl or ignore.

Here are several common examples of how to use robots.txt:

User-agent: *
Disallow: /private/
User-agent: BadBot
Disallow: /
User-agent: *
Allow: /
User-agent: BadBot
Disallow: /
User-agent: *
Allow: /

You can also use Crawl-Delay to add a delay to bots:

User-agent: *
Crawl-Delay: 5
User-agent: BadBot
Crawl-Delay: 10

You may find that not all bots respect robots.txt, and you may need to take different measures: