---
title: "What is robots.txt?"
description: "robots.txt is a text file at the root of a site that tells search and AI crawlers which addresses they may fetch. It controls crawling, not indexing."
url: https://ursy.com/wiki/robots-txt/
updated: 2026-11-26T15:35:33+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/robots-txt/
---

# What is robots.txt?

> robots.txt is a text file at the root of a site that tells search and AI crawlers which addresses they may fetch. It controls crawling, not indexing.

**robots.txt is a plain text file at the root of a website, such as https://example.com/robots.txt, that tells crawlers, AI crawlers included, which addresses they may and may not fetch.** It controls [crawling](https://ursy.com/wiki/crawling/), not indexing: [Google](https://ursy.com/wiki/google/) says it is [not a way to keep a page out of Google](https://developers.google.com/search/docs/crawling-indexing/robots/intro). It is also a request, not a lock. Polite crawlers obey it; others may not.

## What is robots.txt? {#what-is-robots-txt}

Since September 2022 it has been an internet standard: [RFC 9309, the Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309.html). A [search crawler](https://ursy.com/wiki/search-crawler/) or an [AI crawler](https://ursy.com/wiki/ai-crawler/) reads it before it fetches other pages. Google says the main job is to manage crawler traffic, so your server is not overloaded, rather than to hide content.

## Where does it live? {#where-does-it-live}

The file must be called robots.txt, all lower case, at the top of the site. Google’s [robots.txt rules](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt) say a file applies only to the same protocol, host and port. So https://shop.example.com needs its own file; the one on example.com does not cover it. Files in subfolders are not checked. The file must be UTF-8 plain text.

## What does it look like? {#what-does-it-look-like}

This is Google’s own example:

```
User-agent: *
Disallow: /includes/

User-agent: Googlebot
Allow: /includes/

Sitemap: https://example.com/sitemap.xml
```

Every crawler may fetch everything except /includes/. [Googlebot](https://ursy.com/wiki/googlebot/) has its own group, which lets it in there too. The last line points to the [XML sitemap](https://ursy.com/wiki/xml-sitemap/). Lines that start with # are comments.

## How do groups and rules work? {#how-do-groups-and-rules-work}

A group is one or more User-agent lines followed by rules. The User-agent line names a crawler by its product token, such as GPTBot. RFC 9309 says that token should appear in the [bot](https://ursy.com/wiki/bot-web-robot/)’s [user agent](https://ursy.com/wiki/user-agent/) string, and that matching is not case-sensitive. If two groups name the same crawler, their rules are combined. A crawler with no group of its own follows the * group. Paths, by contrast, are case-sensitive: /File.html and /file.html are different rules.

## Which rule wins? {#which-rule-wins}

The most specific rule wins: the one with the longest matching path. If an Allow and a Disallow are equally long, RFC 9309 says the Allow should be used, and Google uses the least restrictive rule. Two characters help: * matches any run of characters, and $ marks the end of the address. The robots.txt file itself is always allowed.

| Rule | Matches | Does not match |
| --- | --- | --- |
| Disallow: /private/ | /private/notes.html | /Private/notes.html |
| Disallow: /*.pdf$ | /files/price-list.pdf | /files/price-list.pdf?v=2 |
| Disallow: /search | /search, /search?q=spade, /searching | /site-search |
| Disallow: / | Every address on the host | /robots.txt, which is always allowed |

## Which fields are supported? {#which-fields-are-supported}

Google supports four fields: user-agent, allow, disallow and sitemap. It does not support [crawl-delay](https://ursy.com/wiki/crawl-delay/). Other crawlers differ. [Anthropic](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler) says it supports the non-standard Crawl-delay line. [Apple](https://support.apple.com/en-us/119829) says Applebot does not follow crawl-delay, and follows your Googlebot rules when the file does not mention Applebot. RFC 9309 itself defines only user-agent, allow and disallow; crawlers may read other lines, such as Sitemap.

## What happens if the file fails? {#what-happens-if-the-file-fails}

| Server answer | RFC 9309 | Google |
| --- | --- | --- |
| 2xx (found) | Rules apply | Rules apply |
| 3xx (redirect) | Follow at least five redirects | Follows at least five hops, then treats it as a 404 |
| 4xx (not there) | May crawl anything | As if there were no file, except 429 |
| 5xx (server error) | Assume everything is disallowed | Stops crawling for the first 12 hours while it keeps trying |

So a server error on robots.txt can stop crawling of the whole site. A missing file does not.

## How big, and how fresh? {#how-big-and-how-fresh}

Google reads up to 500 KiB of the file and ignores anything after that. RFC 9309 says crawlers must parse at least 500 KiB. Google usually caches the file for up to 24 hours, and RFC 9309 says crawlers should not use a cached copy for longer than that unless the file cannot be reached. [OpenAI](https://developers.openai.com/api/docs/bots) says it can take about 24 hours for its search systems to adjust after you change the file.

## Why does it matter for search? {#why-does-it-matter-for-search}

One wrong line can stop [search engines](https://ursy.com/wiki/search-engine/) reading a whole site. A blocked page can still appear in Google, with no description, if other pages link to it: see [indexed, though blocked by robots.txt](https://ursy.com/wiki/indexed-though-blocked-by-robots/). To keep a page out of the [index](https://ursy.com/wiki/search-engine-index/), use [noindex](https://developers.google.com/search/docs/crawling-indexing/block-indexing) and leave the page unblocked, so the crawler can see the rule. Our page on [noindex, nofollow or robots.txt](https://ursy.com/wiki/noindex-nofollow-or-robots-txt/) explains which to use. On large sites, robots.txt also shapes your [crawl budget](https://ursy.com/wiki/crawl-budget/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

Google’s guidance on [AI features and your website](https://developers.google.com/search/docs/appearance/ai-features) says crawling must be allowed in robots.txt, and by any CDN or hosting set-up, and that robots.txt rules for Googlebot are the control for Search, [AI Overviews](https://ursy.com/wiki/ai-overview/) and [AI Mode](https://ursy.com/wiki/google-ai-mode/) included. To limit AI training and [grounding](https://ursy.com/wiki/grounding/) in Google’s other systems, it points to [Google-Extended](https://ursy.com/wiki/google-extended/). Other AI companies give each job its own name, so one file can allow [AI search](https://ursy.com/wiki/ai-search/) and refuse AI training.

## Which AI names can I use? {#which-ai-names-can-i-use}

| Name | Company | What it does |
| --- | --- | --- |
| [GPTBot](https://ursy.com/wiki/gptbot/) | OpenAI | Crawls for training its models |
| [OAI-SearchBot](https://ursy.com/wiki/oai-searchbot/) | OpenAI | Finds pages for [ChatGPT search](https://ursy.com/wiki/chatgpt-search/) |
| [ChatGPT-User](https://ursy.com/wiki/chatgpt-user/) | OpenAI | Fetches a page when a user asks; robots.txt may not apply |
| [ClaudeBot](https://ursy.com/wiki/claudebot/) | Anthropic | Collects content that may be used for training |
| Claude-SearchBot | Anthropic | Crawls to improve search results |
| Claude-User | Anthropic | Fetches pages when a Claude user asks |
| [PerplexityBot](https://ursy.com/wiki/perplexitybot/) | [Perplexity](https://ursy.com/wiki/perplexity/) | Surfaces and links sites in Perplexity search |
| Perplexity-User | Perplexity | Fetches for a user; generally ignores robots.txt |
| Google-Extended | Google | A token only, with no crawler of its own: covers use for training Gemini models |
| [Applebot-Extended](https://ursy.com/wiki/applebot-extended/) | Apple | A token only, with no crawler of its own: covers Apple model training |

Sources: [OpenAI](https://developers.openai.com/api/docs/bots), [Anthropic](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler), [Perplexity](https://docs.perplexity.ai/guides/bots), [Google](https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers) and [Apple](https://support.apple.com/en-us/119829), checked 24 November 2026.

## What about fetches a person asks for? {#what-about-fetches-a-person-asks-for}

A [live fetcher](https://ursy.com/wiki/live-fetcher/) visits a page because a person asked an AI a question. Google says its [user-triggered fetchers](https://developers.google.com/search/docs/crawling-indexing/google-user-triggered-fetchers) generally ignore robots.txt for that reason. Perplexity says the same of Perplexity-User, and OpenAI says robots.txt may not apply to ChatGPT-User. A [training crawler](https://ursy.com/wiki/training-crawler/) is the opposite case: it works on its own schedule, so robots.txt is the right control.

## Is robots.txt a lock? {#is-robots-txt-a-lock}

No. RFC 9309 says its rules are not a form of access authorisation and do not replace real security. Google adds that not every crawler obeys it, and that crawlers read the syntax differently. The file is also public, so a Disallow line can point people to the folder you meant to hide. For real protection use a login, a [web application firewall](https://ursy.com/wiki/web-application-firewall/) or [rate limiting](https://ursy.com/wiki/rate-limiting/).

## Common mistakes {#common-mistakes}

- **Disallow: / left over from a test site.**  It blocks every compliant crawler.
- **Blocking [CSS](https://ursy.com/wiki/css/) and JavaScript.**  Google says not to block resources the page needs to be understood. See [JavaScript SEO](https://ursy.com/wiki/javascript-seo/).
- **Blocking a page you want removed.**  Google cannot then see the [noindex](https://ursy.com/wiki/noindex/).
- **Wrong case.**  Disallow: /Admin/ does not block /admin/.
- **Forgetting [subdomains](https://ursy.com/wiki/subdomain/).**  Each host needs its own file.
- **Blocking AI search by accident.**  Disallowing OAI-SearchBot or PerplexityBot keeps you out of those answers. Choose per bot, not with one * line.
- **Blocking by [IP address](https://ursy.com/wiki/ip-address/) only.**  Anthropic warns this can stop its bot reading robots.txt, so the opt-out may not hold.
- **A robots.txt that errors.**  A 5xx answer can stop crawling. Watch it like a page.

## A worked example {#a-worked-example}

A shop wants search engines and AI search, wants to refuse AI training, and has a filter maze under /search:

```
User-agent: *
Disallow: /search
Disallow: /basket/

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /

Sitemap: https://example.com/sitemap.xml
```

Googlebot, OAI-SearchBot and PerplexityBot follow the * group. The four training names get one shared group that blocks everything. One catch: a crawler with its own group ignores the * group. If you later give Googlebot a group of its own, copy the /search and /basket/ lines into it. Read more in [block AI crawlers](https://ursy.com/wiki/block-ai-crawlers/).

## How to check it {#how-to-check-it}

1. **Read it.**  Open /robots.txt on your site and read every Disallow line. Then run the [Robots.txt Checker](https://ursy.com/robots-txt-checker/) to test any address against your rules.
2. **See which AI bots get in.**  The [AI Bot Checker](https://ursy.com/ai-bot-checker/) shows which of GPTBot, [ClaudeBot](https://ursy.com/wiki/claudebot/), [PerplexityBot](https://ursy.com/wiki/perplexitybot/) and the rest your file lets in.
3. **Check the server answer.**  The [HTTP Header Checker](https://ursy.com/http-header-checker/) shows the status code for /robots.txt. You want 200, never 5xx. If it moves, follow it with the [Redirect Checker](https://ursy.com/redirect-checker/); see [redirect](https://ursy.com/wiki/redirect/).
4. **Check the Sitemap line.**  Run the address through the [XML Sitemap Checker](https://ursy.com/sitemap-checker/). Make sure no page in the sitemap is disallowed.
5. **Check pages you want hidden.**  The [Meta Tag Checker](https://ursy.com/meta-tag-checker/) shows a page’s robots [meta tag](https://ursy.com/wiki/meta-tag/), and the header checker shows any [X-Robots-Tag](https://ursy.com/wiki/x-robots-tag/). Those pages must not be blocked in robots.txt.
6. **Use Search Console.**  In [Google Search Console](https://ursy.com/wiki/google-search-console/), the [robots.txt report](https://support.google.com/webmasters/answer/6062598) shows the files Google found for your top 20 hosts, when it last fetched them and any errors. Use “Request a recrawl” after an urgent fix. The report needs a Domain property.
7. **Check the edge.**  Google says crawling must also be allowed by your [CDN](https://ursy.com/wiki/cdn/). A bot rule there can block what robots.txt allows; see [Cloudflare blocking Googlebot](https://ursy.com/wiki/cloudflare-blocking-googlebot/).
8. **Check who obeys.**  Look in your [server logs](https://ursy.com/wiki/server-logs/) for bots fetching disallowed paths. Test any that claim a famous name with [Verify an AI Bot](https://ursy.com/verify-ai-bot/), because [verified bots](https://ursy.com/wiki/verified-bots/) and fakes look alike by name.
9. **Score the whole set-up.**  The [AI Readiness Checker](https://ursy.com/ai-readiness-checker/) looks at robots.txt alongside other AI signals. [Compare Two Websites](https://ursy.com/compare-websites/) sets your rules against a rival’s.
10. **Manage it over time.**  The [Bot rules manager](https://ursy.com/pro/bot-rules-manager/) writes robots.txt and firewall rules for each bot, and [Rivals’ AI bot rules](https://ursy.com/pro/rivals-ai-bot-rules/) shows which AI bots rivals let in. Both are in URSY Pro, opening in stages.

## What URSY.com counts {#what-ursy-counts}

We count every request, robots.txt included, from the edge log and from the website, and sort each one by its user agent into people, search engines, AI crawlers, [AI agents](https://ursy.com/wiki/ai-agent/) and other machines (API/MCP calls included). We mark each AI and search bot real, fake or unknown against the IP lists the companies publish. That lets you see which bots read your rules and which then fetched pages they were asked to skip. Every rule is on our [methodology](https://ursy.com/methodology/) page; [Crawl budget by bot](https://ursy.com/pro/crawl-budget-by-bot/) in URSY Pro (opening in stages) shows where each bot spends its visits.

## Questions {#questions}

### Does robots.txt stop a page appearing in Google? {#does-robots-txt-stop-a-page-appearing-in-google}

No. It stops crawling. A blocked address can still be listed, without a description, if other sites link to it. Use noindex on an unblocked page instead.

### Do AI companies obey robots.txt? {#do-ai-companies-obey-robots-txt}

Their own crawler pages describe robots.txt as the way to control their automatic crawlers. Fetches a person asks for are different: Google, Perplexity and OpenAI say robots.txt may not apply to them.

### Can I block AI training but stay in AI search? {#can-i-block-ai-training-but-stay-in-ai-search}

Yes, with care. Block training names such as GPTBot, ClaudeBot, Google-Extended and Applebot-Extended, and leave search names such as Googlebot, OAI-SearchBot and PerplexityBot allowed.

### How fast do changes take effect? {#how-fast-do-changes-take-effect}

Google usually caches the file for up to 24 hours. OpenAI says about 24 hours for its search systems.

### Does Google support Crawl-delay? {#does-google-support-crawl-delay}

No. Google supports user-agent, allow, disallow and sitemap only.

## Related words {#related-words}

- [XML sitemap](https://ursy.com/wiki/xml-sitemap/)
- [noindex](https://ursy.com/wiki/noindex/)
- [X-Robots-Tag](https://ursy.com/wiki/x-robots-tag/)
- [User agent](https://ursy.com/wiki/user-agent/)
- [AI crawler](https://ursy.com/wiki/ai-crawler/)
- [Google-Extended](https://ursy.com/wiki/google-extended/)
- [llms.txt](https://ursy.com/wiki/llms-txt/)
- [Crawl budget](https://ursy.com/wiki/crawl-budget/)
- [Technical SEO](https://ursy.com/wiki/technical-seo/)

## Sources {#sources}

- [RFC 9309: Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309.html), checked 24 November 2026
- [Google Search Central: Introduction to robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro), checked 24 November 2026
- [Google Search Central: How Google interprets the robots.txt specification](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt), checked 24 November 2026
- [Google Search Central: AI features and your website](https://developers.google.com/search/docs/appearance/ai-features), checked 24 November 2026
- [Google Search Central: Google’s common crawlers](https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers), checked 24 November 2026
- [Google Search Central: Google’s user-triggered fetchers](https://developers.google.com/search/docs/crawling-indexing/google-user-triggered-fetchers), checked 24 November 2026
- [Google Search Central: Block search indexing with noindex](https://developers.google.com/search/docs/crawling-indexing/block-indexing), checked 24 November 2026
- [Search Console Help: robots.txt report](https://support.google.com/webmasters/answer/6062598), checked 24 November 2026
- [OpenAI: Overview of OpenAI crawlers](https://developers.openai.com/api/docs/bots), checked 24 November 2026
- [Anthropic: Does Anthropic crawl data from the web, and how can site owners block the crawler?](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler), checked 24 November 2026
- [Perplexity: Perplexity crawlers](https://docs.perplexity.ai/guides/bots), checked 24 November 2026
- [Apple: About Applebot](https://support.apple.com/en-us/119829), checked 24 November 2026

*Updated 24 November 2026 by URSY.com.*
