A robots.txt file is a plain-text file at a site's root that tells search engine crawlers which URLs they can request, written in a format Google now ties to the IETF's own Robots Exclusion Protocol standard, RFC 9309. It controls crawling, not indexing: a URL blocked in robots.txt can still appear in Google Search results if other pages link to it, because Google never fetches the page to find a reason not to show it.
Key takeaways
- Definition: robots.txt sits at a domain's root and lists User-agent, Allow, Disallow and Sitemap rules that tell crawlers which paths to request.
- Scope: Google states the file controls crawling, not indexing, and recommends a noindex meta tag or password protection to keep a page out of Search.
- Size limit: Google enforces a 500 KiB (512,000-byte) cap on robots.txt and ignores any content past that point.
- Support: Google supports User-agent, Allow, Disallow and Sitemap; it does not support Crawl-delay.
- History: Google stopped honoring Noindex, Nofollow and Crawl-delay written inside robots.txt on 1 September 2019, after finding other rules already contradicted Noindex in all but 0.001% of the files it analysed.
What Is a Robots.txt File?
A robots.txt file is a plain-text file placed at a website's root directory that tells search engine crawlers which URLs on that site they can request. Google's own documentation states a robots.txt file "tells search engine crawlers which URLs the crawler can access on your site," and that the file exists mainly to manage crawler traffic, not to enforce privacy.
The file is one of the first things a technical SEO review checks, since every other crawl- and index-facing fix depends on Googlebot being able to reach the right pages first.
The file works as a request, not a command. The Robots Exclusion Protocol, formalized by the IETF as RFC 9309 in September 2022, states plainly that "these rules are not a form of access authorization" and that the protocol "is not a substitute for valid content security measures." A well-behaved crawler such as Googlebot reads and follows the file's rules as part of overall crawlability; nothing in the file stops a crawler that chooses to ignore it.
Where Does a Robots.txt File Go?
A robots.txt file lives at the root of a domain, reachable at a URL such as https://example.com/robots.txt, never inside a subfolder. A crawler checks only that one location per host, so a file saved at example.com/blog/robots.txt has no effect on anything.
A subdomain needs its own separate robots.txt, because crawlers treat shop.example.com and example.com as two distinct hosts with two distinct root locations. A site running on HTTP and HTTPS versions of the same domain, or on both a www and non-www host, needs a robots.txt reachable at each one it serves, since RFC 9309 ties the file to the exact scheme and host a request uses.
What Does Robots.txt Syntax Look Like?
Robots.txt syntax builds every rule from 4 possible directives, User-agent, Allow, Disallow and Sitemap, grouped under a User-agent line with one or more Allow or Disallow paths beneath it, each on its own line in plain text. A group that targets every crawler uses a wildcard User-agent: *; a group naming a specific crawler, such as User-agent: Googlebot, applies only to that one.
| Directive | What it does | Example |
|---|---|---|
| User-agent | Names the crawler the group below applies to | User-agent: * |
| Disallow | Blocks crawling of a path and everything under it | Disallow: /admin/ |
| Allow | Carves out an exception inside a disallowed path | Allow: /admin/public/ |
| Sitemap | Points crawlers to an XML sitemap's full URL | Sitemap: https://example.com/sitemap.xml |
A path match is case-sensitive and matches by prefix, so Disallow: /folder blocks /folder, /folder/ and /folder-name alike. Adding the trailing slash, Disallow: /folder/, narrows that match to the folder itself and whatever sits inside it. Each rule's path mirrors a site's own website structure directly, so a folder reorganization on the server usually means a matching edit to robots.txt, not a separate, forgotten step.
Which Robots.txt Rules Does Google Support?
Google supports 4 fields in robots.txt: user-agent, allow, disallow and sitemap. Google's robots.txt specification states directly that "other fields such as crawl-delay aren't supported," naming Crawl-delay as the clearest example of a once-common directive Googlebot now ignores outright.
A site slowing Googlebot down uses the crawl-rate controls inside Google Search Console instead, since no line inside robots.txt itself changes Googlebot's request rate. Other crawlers vary: some respect Crawl-delay, so a multi-crawler site often keeps the directive for those bots even though Google skips straight past it.
Does Robots.txt Still Support Noindex?
Robots.txt has not supported a Noindex directive since 1 September 2019, when Google stopped honoring Noindex, Nofollow and Crawl-delay rules written inside the file. Google's announcement, published 2 July 2019, gave roughly 2 months' notice before the change took effect.
Google's own reason was consistency, not caution: the post states that usage of the unofficial Noindex rule was already contradicted by other rules in all but 0.001% of the robots.txt files Google analysed across the internet, meaning the directive rarely did what its author intended even while Google still read it. A page-level noindex meta tag or HTTP header, not a robots.txt line, is the current way to keep a specific URL out of Google's index.
How Big Can a Robots.txt File Be?
A robots.txt file can reach 500 KiB (512,000 bytes) before Google stops reading it. Google's specification states that "content which is after the maximum file size is ignored," so any rule placed past that cutoff has no effect at all, silently.
500 KiB holds thousands of individual Disallow lines, far more than almost any real site needs, so hitting the limit usually signals a generation bug (a script appending duplicate rules on every build) rather than a genuinely large rule set. Google also caches a fetched robots.txt for up to 24 hours before re-checking it, so a change to the file does not reach Googlebot instantly.
Does Robots.txt Keep a Page Out of Google Search?
Robots.txt does not keep a page out of Google Search on its own. Google states directly that the file "is not a mechanism for keeping a web page out of Google," because a URL other sites link to can still surface in results by its bare address even when Googlebot has never been allowed to crawl it.
Blocking a URL in robots.txt while also relying on it to remove that same URL from the index creates the exact failure Google warns against: once Disallow is in place, Googlebot cannot fetch the page to discover a noindex tag sitting on it, so the stale, link-only listing can persist. The 2 tools solve 2 different problems: Disallow manages crawl traffic and crawl budget, and a noindex tag or password protection controls whether a page is eligible to appear in results at all.
How Does Robots.txt Affect Crawlability and Indexing?
Robots.txt shapes crawlability directly by naming the paths Googlebot may or may not request, which determines how much of a site's crawl budget goes to pages worth indexing. A sprawling Disallow list that accidentally blocks CSS or JavaScript makes crawlability and indexing worse, stopping Google from rendering a page the way a visitor sees it until the next recrawl, up to 24 hours behind a fix.
The RFC's own access-authorization disclaimer matters here too: a Disallow rule only ever withholds a path from crawlers that choose to respect it, so it never substitutes for a real access control on genuinely sensitive content such as an admin panel or a customer's private data.
How Do You Add a Sitemap to Robots.txt?
A Sitemap line in robots.txt points crawlers to an XML sitemap's full, absolute URL, written as its own line anywhere in the file, independent of any User-agent group: Sitemap: https://example.com/sitemap.xml. Multiple sitemaps, including a sitemap index file covering multiple smaller sitemaps, each get their own Sitemap line.
The 2 files do different jobs even though they sit side by side. Robots.txt tells a crawler where it may not go; the sitemap tells a crawler which URLs the site owner considers worth finding, so pairing an accurate sitemap with a clean robots.txt gives Googlebot both a clear boundary and a clear map inside it.
What Mistakes Break a Robots.txt File?
The most common robots.txt mistakes block resources a page requires for rendering, place the file somewhere other than the domain root, or rely on it for jobs the file was never built to do. Each mistake below has a distinct, checkable fix:
- Disallowing CSS or JavaScript folders: stops Googlebot from rendering the page the way a visitor sees it, which can hide content and layout from evaluation entirely.
- Leaving a staging or development site open: a missing or misconfigured robots.txt on a non-production host lets crawlers index pages nobody meant to publish.
- Treating Disallow as a security boundary: RFC 9309 states the protocol is not an access-authorization mechanism, so sensitive paths need real authentication, not a text file.
- Writing Noindex or Crawl-delay into the file: both have been unsupported by Google since 1 September 2019 and 2019's parser update respectively; neither line does anything to Googlebot today.
- Forgetting the trailing slash on a folder rule:
Disallow: /folderalso matches/folder-name, a prefix match that blocks more than intended.
How Do You Test a Robots.txt File?
Testing a robots.txt file means confirming the live version at the domain root parses cleanly and blocks or allows the exact paths intended, checked against Googlebot's actual behavior, not assumptions about the syntax. Search Console's URL Inspection tool shows whether a URL is blocked by the live robots.txt, pulled from the same copy Googlebot caches for up to 24 hours, so a fresh edit does not show up in a test immediately.
A server's own request logs give the ground-truth check a syntax review cannot: log file analysis shows whether Googlebot is requesting the paths a robots.txt file allows, and whether any blocked path is still receiving crawler requests, a sign of a rule that was never applied or a crawler ignoring it outright.
What Belongs on a Robots.txt Checklist?
A robots.txt checklist starts with placement and syntax, moves through the 4 rules Google supports, and ends with the testing step that confirms the file behaves on Googlebot the way it reads on screen. The 6-item list below runs in that exact find-to-verify order, matching the structure covered section by section above.
- Confirm the file sits at the domain root: reachable at
/robots.txton the exact host and scheme being served. - Use only the 4 fields Google supports: User-agent, Allow, Disallow and Sitemap.
- Remove any Noindex or Crawl-delay lines: neither has worked on Googlebot since 2019.
- Check Disallow rules against rendering needs: confirm CSS, JavaScript and image paths a page needs stay allowed.
- Add a Sitemap line with the sitemap's full URL: one line per sitemap or sitemap index.
- Verify with Search Console and server logs: confirm the live file matches intent, then confirm Googlebot's actual requests match the file.
Robots.txt is one check inside a wider technical SEO audit, alongside a site's HTTPS and website security for SEO, its mobile SEO, JavaScript SEO, structured data, each canonical tag, hreflang tags, redirects and Core Web Vitals; a full technical SEO checklist walks through all of them together.
| Number | What it means | Source |
|---|---|---|
| 500 KiB | Google's maximum robots.txt file size; content past this point is ignored | Google, robots.txt specification |
| 24 hours | How long Google generally caches a robots.txt file before re-checking it | Google, robots.txt specification |
| 4 | Fields Google's robots.txt parser supports: User-agent, Allow, Disallow, Sitemap | Google, robots.txt specification |
| 1 September 2019 | Date Google stopped honoring Noindex, Nofollow and Crawl-delay in robots.txt | Google Search Central Blog, 2 July 2019 |
| 0.001% | Share of analysed robots.txt files where Google's Noindex rule was not already contradicted by another rule | Google Search Central Blog, 2 July 2019 |
Robots.txt FAQ
What is a robots.txt file?
A robots.txt file is a plain-text file placed at a website's root directory that tells search engine crawlers which URLs on that site they can request.
Where does a robots.txt file go?
A robots.txt file lives at the root of a domain, reachable at a URL such as https://example.com/robots.txt, never inside a subfolder.
Which robots.txt rules does Google support?
Google supports 4 fields in robots.txt: user-agent, allow, disallow and sitemap. Other fields, including Crawl-delay, are not supported.
Does robots.txt still support Noindex?
No. Google stopped honoring Noindex, Nofollow and Crawl-delay rules written inside robots.txt on 1 September 2019.
Does robots.txt keep a page out of Google Search?
Not on its own. Google is explicit that robots.txt cannot hide a page from Google Search by itself, since a blocked URL other sites link to can still appear in results by its bare address.
How big can a robots.txt file be?
Google enforces a 500 KiB (512,000-byte) limit on robots.txt and ignores any content placed after that point in the file.
The Bottom Line
A robots.txt file controls crawling, not indexing, through 4 fields Google supports (User-agent, Allow, Disallow, Sitemap), inside a 500 KiB limit, under a formal IETF standard, RFC 9309, published in September 2022. Noindex, Nofollow and Crawl-delay have done nothing inside the file since 1 September 2019, so a file still carrying them is a decade behind Googlebot's actual behavior. Request Banana Marketing's technical SEO audit to check whether a site's robots.txt is helping its crawl budget or quietly working against it.

