The Robots Exclusion Protocol is how a site tells crawlers what they may fetch
and what may appear in a search index. It splits across three surfaces — the
robots.txt file, the HTML <meta name="robots"> tag, and the X-Robots-Tag
HTTP response header — and not every directive is supported everywhere. This
reference lists each directive, what it does, and which engines honour it.
How it works
Crawling and indexing are two separate stages. robots.txt is consulted
before a URL is fetched, so it governs crawling only. Directives like
noindex and nofollow are read after the page is fetched, from the meta tag
or the X-Robots-Tag header, so they govern what happens to the content once a
bot already has it.
A critical consequence: a page that is Disallow-ed in robots.txt is never
fetched, so the bot never sees a noindex tag inside it. Such a page can still
appear in results as a bare URL. To reliably remove a page from an index, leave
it crawlable and serve a noindex directive.
Major engines extend the original 1994 standard with pattern matching: * for
any character sequence and $ to anchor the URL end. These are honoured by
Google and Bing but are not part of the formal RFC 9309 specification.
The three surfaces and when to use each
robots.txt
Use for crawl-budget management and to keep bots away from entire directory trees (staging areas, internal search results, account dashboards). It is the right tool when you want to stop a crawler from even fetching the content — reducing server load or preventing raw database query strings from being crawled.
meta robots tag
Use for indexing control on individual HTML pages. A <meta name="robots" content="noindex"> tag tells any crawler that fetched the page not to include
it in the index. Because the tag lives in the HTML, it is per-page and
requires the bot to fetch the page first.
X-Robots-Tag HTTP header
Use for non-HTML assets — PDFs, images, documents — where you cannot add an HTML meta tag. The header is served with the file and instructs bots in the same way the meta tag does for HTML.
Common directive combinations
| Goal | Correct approach |
|---|---|
| Block a page from search results | noindex in meta tag or X-Robots-Tag; keep the page crawlable |
| Stop crawlers fetching a folder | Disallow: /folder/ in robots.txt |
| Block all links on a page being followed | nofollow in meta tag |
| Prevent a PDF from being indexed | X-Robots-Tag: noindex in the HTTP response |
| Keep a page crawlable but exclude its images | noimageindex in meta tag |
Tips and examples
- To keep a page out of search, use
noindex(meta or header), notDisallow. Disallow:with an empty value allows everything;Disallow: /blocks the whole site for that user-agent.- Combine directives in one tag:
<meta name="robots" content="noindex, nofollow">. - Use
X-Robots-Tagfor non-HTML files (PDFs, images) where you cannot add a meta tag. - Google dropped support for an unofficial
noindexdirective in robots.txt in 2019. Using it there no longer works. - Always test changes in Google Search Console’s robots.txt tester before
deploying — a stray
Disallow: /can deindex an entire site overnight.