How robots.txt works comes down to one job: it tells crawlers which URLs they may fetch. It does not reliably remove a page from Google Search, because a blocked page can still be indexed from links and other signals. To remove a page, use a noindex robots meta tag or the X-Robots-Tag HTTP header and leave the URL crawlable.
How robots.txt works: fetch rules, not removal
How robots.txt works is straightforward: it is a plain text file served at the root of a host that tells crawlers which URLs they may fetch. Google describes it as the standard way sites signal which parts of a site are open to automated access, and a companion line of control exists for indexing.
The file must sit at the root path of a domain or subdomain. example.com/robots.txt is read; example.com/products/robots.txt is not. A subdomain is a separate host, so shop.example.com/robots.txt is a valid and separate file. Google's robots.txt introduction states the same location rule.
Each line of the file is a rule that allows or disallows URLs or URL patterns for named bots. A User-agent line selects the crawler, and Disallow or Allow lines list paths. Most content management systems and site builders expose a setting or plugin for editing the file.
Compliance is voluntary. Googlebot follows robots.txt, and Google states that most commercial crawler operators do too, but other bots on the internet may ignore it. A robots.txt rule is a request to well-behaved crawlers.
What robots.txt rules look like in practice
A robots.txt rule pairs a user agent with one or more path patterns, and a wildcard and a sitemap directive make the file easier to maintain. The transcript's worked example gets across the basic shape: one group blocks a path prefix for all crawlers.
The pattern below is illustrative structure rather than a copy of a live file. Paths are matched from the left, and the asterisk stands in for any string.
User-agent: *
Disallow: /no-touchy
User-agent: SteveBot
Allow: /no-touchy
Sitemap: https://example.com/sitemap.xml
An empty Disallow: line under a user agent means nothing is blocked for that crawler. A Disallow: / blocks the whole host. Groups are matched by user-agent name, so a crawler that matches a specific group uses that group rather than the wildcard group.
The Sitemap directive points crawlers at an XML sitemap. It works as a discovery hint and does not grant or remove crawl permission. The robots.txt specification published in 2022 as RFC 9309 defines the syntax and matching rules.
Crawl control versus index control
Crawl control decides whether Googlebot may fetch a URL, while index control decides whether the page may appear in results, and the two are set by different mechanisms. Confusing them is the most common robots.txt mistake.
The table below compares the three controls the talk covers on the dimensions that matter for a decision.
| Control | Where it lives | Effect | Best use |
|---|---|---|---|
| robots.txt | Text file at host root | Blocks fetching of matching URLs | Crawl budget, private directories |
| robots meta tag | HTML head of the page | Blocks indexing of the page | Keep a crawlable page out of results |
| X-Robots-Tag | HTTP response header | Blocks indexing, applies to non-HTML too | PDFs, images, other non-HTML files |
The robots meta tag is an HTML element in the page head with name="robots" and directives in its content value. Google's robots meta tag documentation lists the accepted values, including noindex and snippet controls such as nosnippet.
For granular control, the name can target one crawler. Using googlebot-news instead of robots limits the directive to Google News indexing while leaving regular Google Search indexing in place. Several directives can share one tag, for example suppressing snippets and translations together.
The X-Robots-Tag HTTP header carries the same directives as the meta tag and works on responses that are not HTML, such as PDFs. That makes it the practical option for files where a meta element cannot be inserted.
Why robots.txt plus noindex still shows the page
Blocking a URL in robots.txt and adding noindex to the same page produces a conflict, because Googlebot must fetch a page to see its noindex directive. If fetching is disallowed, the directive is never read.
The sequence runs in three steps. Googlebot finds a link to the page somewhere else on the web. It requests the URL and reads the robots.txt file, which tells it the fetch is not allowed. It then knows the URL exists but has no page content, and noindex sits inside that unread content.
Google's guidance in the same robots meta tag documentation is to use noindex or the X-Robots-Tag header for removal and not to disallow the URL in robots.txt. A blocked URL can still be indexed from external signals with whatever limited information Google holds.
This is also why robots.txt is a poor tool for removing sensitive material. A blocked page can still be linked, and Google's robots.txt introduction notes that a URL listed in robots.txt may appear in results without a description. Password protection and removing the content are the controls for genuinely private material.
Using Search Console and a robots.txt tester
The robots.txt report in Google Search Console shows which host-level files Google has fetched and flags syntax problems, and it is the first place to check after an edit. The open-source robots.txt tester linked in the video description offers a second check.
The report lists the robots.txt files Google knows about for your property, the last fetch time, and any rules Google could not parse. It does not tell you whether a page is indexed. For that question, use URL Inspection or a site: query.
A tester lets you paste a URL against a draft file and see which group and rule wins. That is useful for wildcard and user-agent precedence questions, where hand-reading long files gets unreliable. Google's 2025 Robots Refresher series and the 2019 robots.txt recap both walk through precedence rules in more depth.
Treat both tools as diagnostics for fetching. Neither one proves a page is out of the index, because index status depends on directives that only apply after a successful fetch.
What changed since robots.txt became an RFC
The Robots Exclusion Protocol was created in 1994 by Martijn Koster, and RFC 9309 formalized it in 2022 after three years of community work through the IETF. Google's own 2019 announcement notes that the protocol had run for 25 years as an informal standard with no official specification.
In practical terms the format barely moved. Google states the file format has stayed largely unchanged since its early days and that old files still work. The RFC mainly settled ambiguous matching, wildcard and group-order behavior that implementations had read differently.
For site owners, that means the guidance in a 2024 talk still holds in 2026. The mechanism, the root-path requirement, the fetch-only scope and the noindex conflict are unchanged. The toolkit has widened, not been replaced.
One thing worth checking on any site is whether a CDN, WAF or edge rule serves a different robots.txt than the origin. A 403 or 503 on the robots.txt URL can cause Google to treat rules differently, so confirm the live response matches what the CMS shows.
FAQ
- Does robots.txt remove a page from Google? No. robots.txt controls whether Googlebot may fetch a URL, and a blocked URL can still be indexed from links and other signals. To remove a page, use a
noindexrobots meta tag or theX-Robots-Tagheader and keep the URL crawlable.
- Can robots.txt live in a subdirectory? No. The file must be at the root of the host, such as
example.com/robots.txt. A path likeexample.com/products/robots.txtis ignored, but a subdomain such asshop.example.comhas its own root-level file.
- Do all bots obey robots.txt? Not all. Googlebot and most commercial search crawlers follow it, but compliance is voluntary. Google states that most commercial crawler operators follow the rules, which leaves room for other automated clients to ignore them.
- Where do I test a robots.txt change? Use the robots.txt report in Google Search Console to see fetch status and parsing issues. A standalone robots.txt tester can show which rule wins for a given URL against a draft file.
- Can I target a single crawler in robots.txt? Yes. A
User-agentline names the crawler, and the rules that follow apply to that group. A wildcard group withUser-agent: *covers crawlers that do not match a named group.