Robots File
A robots file (robots.txt) sits at a site's root and tells crawlers which URLs they may request. It controls crawling, not indexing, and relies on good faith.
What is a Robots File?
A robots file, or robots.txt, is a plain text file placed at the root of a domain (for example https://example.com/robots.txt) that tells web crawlers which URLs they may request. It uses simple rules such as User-agent, Disallow and Allow. Robots.txt manages crawling, not indexing, and relies on crawlers choosing to follow it.
The Robots Exclusion Protocol dates back to 1994 and was formalized as an internet standard, RFC 9309, in 2022. In 2026 it matters more than ever because it is the main control site owners have over AI crawlers as well as search engine bots.
How it works
A basic file:
User-agent: *
Disallow: /internal-search/
Allow: /
User-agent: GPTBot
Disallow: /
Sitemap: https://example.com/sitemap.xml
Key rules:
- Each group starts with
User-agentand applies to crawlers that match it; the most specific group wins. Disallowblocks a path prefix;Allowcreates exceptions.- Google supports
*and$wildcards. - One file per host and protocol:
blog.example.comneeds its own file. - Google ignores
crawl-delayand does not supportnoindexin robots.txt.
Common AI-related user agents include GPTBot and OAI-SearchBot (OpenAI), PerplexityBot, ClaudeBot (Anthropic) and Google-Extended, a token that controls use of content for Gemini models but does not affect Google Search.
Examples
- A B2B SaaS site blocks
/app/and/internal-search/to stop crawlers wasting time on logged-in and infinite search URLs. - A cybersecurity vendor discovers a leftover
Disallow: /from staging on its production site after traffic collapses. Removing it and requesting recrawls restores visibility over the following days. - A DevTools company allows OAI-SearchBot and PerplexityBot so its docs can be cited in AI answers, while making a separate decision about training crawlers.
Best practices
- Keep the file short and test it with Search Console’s robots.txt report.
- Never block CSS or JavaScript files needed for rendering.
- Use noindex, not robots.txt, for pages you want removed from search.
- Reference your XML sitemap.
- Review AI crawler rules deliberately; inherited blanket blocks from a CDN or security template are common.
Common mistakes
- Blocking a page and adding noindex to it, which means Google never sees the noindex.
- Treating robots.txt as security; the file is public and non-compliant bots ignore it.
- Shipping staging rules to production.
Robots file and AI search
If AI search crawlers cannot fetch your pages, engines that rely on live retrieval have little to cite. Check robots.txt, CDN bot settings and firewall rules together, since any of them can block AI agents. See how AI engines cite sources.
Related terms
Sources
Frequently asked questions
Does robots.txt stop a page from being indexed?
No. Robots.txt stops compliant crawlers from fetching a URL, but Google can still index a blocked URL without its content if other pages link to it. To keep a page out of results, allow crawling and add a noindex meta tag or X-Robots-Tag header.
Does Google support crawl-delay or noindex in robots.txt?
No. Google ignores the crawl-delay directive and stopped supporting noindex rules in robots.txt in 2019. Bing does honor crawl-delay. Google adjusts crawl rate automatically based on how your server responds. To reduce Googlebot load, fix server performance or return 503 or 429 temporarily.
Should I block AI crawlers in robots.txt?
It depends on your goals. Blocking search-oriented AI crawlers can keep your content out of AI answers and citations. Many B2B SaaS companies allow them for visibility. Some vendors offer separate user agents for training versus search, so you can make different choices for each.