Free auditStart free
GlossaryGlossary · Crawling

robots.txt

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 withChatGPTClaudePerplexityGoogleAI Mode
01Checklist

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.
First1
Each host and protocol needs its own file. https://shop.example.com/robots.txt doesn't cover https://example.com.
Next1
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.
Then1
A crawler uses only the most specific group that names it, so a GPTBot group replaces the * group for 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
02Good 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.

03Worth 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.

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
04Good to know

robots.txt and AI crawlers

OpenAI documents separate robots.txt tags for its crawlers, so you can treat training and search differently. Per OpenAI, you can allow OAI-SearchBot to appear in ChatGPT search results while disallowing GPTBot to indicate that crawled content should not be used for training. Each setting is independent of the others.
05At 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.

01Does 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.

02Where 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.

03Is 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. 01Introduction to robots.txtdevelopers.google.com · checked 2026-10-24
  2. 02How Google interprets the robots.txt specificationdevelopers.google.com · checked 2026-10-24
  3. 03RFC 9309: Robots Exclusion Protocolrfc-editor.org · checked 2026-10-24
  4. 04Reduce the Googlebot crawl ratedevelopers.google.com · checked 2026-10-24
  5. 05OpenAI crawlers and user agentsdevelopers.openai.com · checked 2026-10-24
Free · 2 minutes

Know the term. Now check your site.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly