A robots.txt file is a plain-text file that lives at the root of your domain. When a crawler visits your site, it checks this file first to see which paths it's allowed to access. Googlebot, Bingbot, and most other search engine crawlers respect it.
The file uses a simple line-based format. Each block starts with a
User-agent: line to identify the crawler, followed by
Allow: or Disallow: rules for that agent:
The * is a wildcard that matches all crawlers. A more
specific user-agent (like GPTBot or Googlebot)
applies its own rules, and takes precedence over the wildcard block for
that specific crawler.
Allow: grants access to a path or set of paths.
Disallow: blocks access. When both apply to the same
path, the more specific rule wins โ so a Disallow: /
followed by Allow: /public means everything is blocked
except /public.
Paths can include wildcards: * matches any sequence of
characters, and $ anchors to the end of the URL.
Disallow: /*.pdf$ blocks every URL ending in
.pdf.
Since around 2023, many site owners have used robots.txt to block AI training crawlers. The most common bots and the companies that run them:
The Block AI bots preset blocks all of these while leaving regular search engines unaffected. Google will still index your site for search โ it just won't use the content for AI training.
A few important limitations:
Disallow prevents re-crawling but doesn't remove the existing entry. Use noindex meta tags for that.Disallow only tells crawlers not to fetch it.https://yourdomain.com/robots.txt.
Not in a subfolder. Only one robots.txt per domain.