# robots.txt

> robots.txt tells crawlers which URLs they may request. How the rules work, what it can

Canonical: https://scaplet.com/glossary/robots-txt

Glossary Glossary · Crawling

robots.txt tells crawlers which URLs they may request. How the rules work, what it can't do (keep pages out of Google), and examples to copy.

3 min

read

5

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

robots.txt is a plain text file at the root of a site that tells crawlers which URLs they may request. It controls crawling, not indexing: a blocked URL can still appear in Google if other pages link to it. To keep a page out of search results, use a noindex rule instead.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Frobots-txt%20(%22robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Frobots-txt%20(%22robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Frobots-txt%20(%22robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Frobots-txt%20(%22robots.txt%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 5 parts, 3 minutes.

1. [How robots.txt works 01](#how-robots-txt-works)
2. [What robots.txt can't do 02](#what-robots-txt-can-t-do)
3. [Tips most guides miss 03](#tips-most-guides-miss)
4. [robots.txt and AI crawlers 04](#robots-txt-and-ai-crawlers)
5. [Limits worth knowing 05](#limits-worth-knowing)

_01_Checklist

## How robots.txt works

A crawler that follows the Robots Exclusion Protocol fetches `/robots.txt` before crawling a host, finds the group of rules whose `User-agent` line matches its name, and applies the `Allow` and `Disallow` rules in that group. The protocol was standardised by the IETF as RFC 9309 in 2022.

First_1_
Each host and protocol needs its own file. `https://shop.example.com/robots.txt` doesn't cover `https://example.com`.

Next_1_
When several rules match a URL, the most specific (longest) rule wins. If an `Allow` and a `Disallow` rule are equally specific, the less restrictive `Allow` wins.

Then_1_
A crawler uses only the most specific group that names it, so a `GPTBot` group replaces the `*` group for [GPTBot](/ai-crawlers/gptbot) rather than adding to it.

A typical file

```
User-agent: * Disallow: /cart/ Disallow: /search User-agent: GPTBot Disallow: / Sitemap: https://example.com/sitemap.xml
```

_02_Good to know

## What robots.txt can't do

Google is explicit that robots.txt is not a way to keep a page out of its results. If other sites link to a blocked URL, Google can index the URL without crawling it, usually with no description. And because Google can't crawl a blocked page, it never sees a `noindex` tag placed on it.

robots.txt is also not access control. The file is public and compliance is voluntary. Anything that must stay private needs authentication.

The classic mistake

Blocking a page in robots.txt *and* adding [noindex](/glossary/noindex) to it. The block stops Google from reading the noindex, so the page can stay indexed. Remove the block, let Google recrawl and see the noindex, then decide whether to block.

_03_Worth knowing

## Tips most guides miss

### Edits aren't instant

Google generally caches robots.txt for up to 24 hours, and longer when it can't refresh. Don't expect a fix to take effect the minute you deploy it.

### Rules past 500 KiB are ignored

Google enforces that size limit and ignores content after it. Large generated files with per-URL rules can silently lose their last lines.

### A 5xx on robots.txt is worse than a 404

A 4xx (except 429) means no restrictions. A 5xx makes Google stop crawling the site for 12 hours.

### Scope is host, protocol and port

Rules apply only to the host, protocol and port number where the file is hosted, so `http://` and `https://` need consistent files.

### Longest path wins

With `Disallow: /downloads/` and `Allow: /downloads/free/`, a URL under `/downloads/free/` is allowed because that rule is longer. On a tie, Google uses the least restrictive rule.

### `crawl-delay` is ignored

Google doesn't support it. To slow [Googlebot](/ai-crawlers/googlebot) you return 500, 503 or 429, covered in [HTTP status codes](/glossary/http-status-codes).

Check it in 2 minutes

```
curl -sI https://example.com/robots.txt | head -n 1 # want HTTP/2 200 curl -s https://example.com/robots.txt | wc -c # want well under 512000 bytes
```

_04_Good to know

## robots.txt and AI crawlers

[OpenAI](/ai-search/chatgpt/how-it-finds-sources) documents separate robots.txt tags for its crawlers, so you can treat training and search differently. Per OpenAI, you can allow [OAI-SearchBot](/glossary/chatgpt-search) to appear in ChatGPT search results while disallowing [GPTBot](/ai-crawlers/gptbot) to indicate that crawled content should not be used for training. Each setting is independent of the others.

Good to know

Scaplet's audit reads your live robots.txt alongside sitemaps, status codes and canonicals, so you can see what crawlers are told before you change a rule.

_05_At a glance

## Limits worth knowing

Behaviour

### File size

What Google documents

Google processes the first 500 KiB and ignores the rest

Behaviour

### Caching

What Google documents

Generally cached for up to 24 hours, longer if a refresh isn't possible

Behaviour

### 4xx response (except 429)

What Google documents

Treated as if no robots.txt exists: no crawl restrictions

Behaviour

### 5xx response

What Google documents

Google stops crawling the site for the first 12 hours while retrying, then uses the last good version for up to 30 days

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Does robots.txt stop a page from being indexed?

No. It stops compliant crawlers from fetching the page. Google can still index a blocked URL that other pages link to. Use a noindex meta tag or X-Robots-Tag header on a crawlable page to keep it out of results.

_02_ Where does robots.txt have to live?

At the root of the host, for example https://example.com/robots.txt. Google says the file must sit in the top-level directory of the site.

_03_ Is robots.txt case-sensitive?

Paths in rules are case-sensitive, so Disallow: /Admin doesn't block /admin. Google matches user-agent names case-insensitively.

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- google.com
- rfc-editor.org
- openai.com

1. 01 [Introduction to robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro) developers.google.com · checked 2026-10-24
2. 02 [How Google interprets the robots.txt specification](https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec) developers.google.com · checked 2026-10-24
3. 03 [RFC 9309: Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309.html) rfc-editor.org · checked 2026-10-24
4. 04 [Reduce the Googlebot crawl rate](https://developers.google.com/crawling/docs/crawlers-fetchers/reduce-crawl-rate) developers.google.com · checked 2026-10-24
5. 05 [OpenAI crawlers and user agents](https://developers.openai.com/api/docs/bots) developers.openai.com · checked 2026-10-24

## Keep learning

[All glossary](/glossary)

[Learn User agent Crawling and indexing](/glossary/user-agent) [Related GPTBot OpenAI](/ai-crawlers/gptbot) [Read next Bot management Crawling and indexing](/glossary/bot-management) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[ROAS (return on ad spend)](/glossary/roas) [Robots meta tag](/glossary/robots-meta-tag) [SaaS SEO](/glossary/saas-seo) [Sales qualified lead (SQL)](/glossary/sales-qualified-lead)

More in Crawling
[Crawl-delay](/glossary/crawl-delay) [Faceted navigation](/glossary/faceted-navigation) [robots.txt](/glossary/robots-txt) [Soft 404](/glossary/soft-404)

Terms on this page
[Noindex](/glossary/noindex) [HTTP status codes](/glossary/http-status-codes) [ChatGPT search](/glossary/chatgpt-search)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
