A robots.txt file is a plain text file at the root of your site that tells crawlers which URLs they should not fetch. Crawlers that follow the standard read it before they crawl. Crawlers that do not follow it can ignore it, and nothing in the file stops them.
Our pillar on what SEO is and how search works now lists robots.txt as one of the first things to check. This piece goes deeper: the standard, the syntax with a sample, common mistakes, WordPress and Drupal defaults, and the AI crawler names that matter now.
The short version: robots.txt controls crawling. It does not control indexing or access. To keep a page out of Google, use noindex. To keep a page private, put it behind a login. For AI, most companies now split training crawlers from search crawlers, so you can block training and still appear in AI search answers. Read each company’s own documentation before you block anything.
What robots.txt is, according to RFC 9309
The file dates to 1994. The IETF published it as a standard in September 2022 as RFC 9309, the Robots Exclusion Protocol. Its authors include Martijn Koster and Gary Illyes of Google.
Rules every site owner should know:
- Location. The file lives at the top level of the host, in lowercase: example.org/robots.txt.
- Matching. Crawlers match their name case-insensitively. The most specific rule, meaning the longest path match, wins.
- Fallback. If no group names a crawler, it obeys the group for “*”.
- Errors. If the file is missing (a 4xx error), crawlers may fetch anything. If the server errors out (5xx), they must assume everything is disallowed.
- Caching. Crawlers should not use a cached copy for more than 24 hours.
The RFC is also direct about limits. It says: "These rules are not a form of access authorization." Its security section adds that "Listing paths in the robots.txt file exposes them publicly."
What robots.txt does not do: noindex vs disallow
Google’s introduction to robots.txt says the file is used "primarily to manage crawler traffic to your site." It also says it "is not a mechanism for keeping a web page out of Google."
A disallowed page can still be indexed if other sites link to it. Google says the URL can then appear in results without a description.
Noindex is the tool for keeping a page out of results. It goes in a meta tag on the page or in an HTTP header for files like PDFs. But Google’s noindex documentation says a page blocked by robots.txt never shows its noindex rule to the crawler. Disallow plus noindex means the noindex does nothing.
So pick one job per page:
- Disallow when you want crawlers to skip URLs, such as admin screens or endless filter combinations.
- Noindex when crawlers may visit but the page should not appear in results.
- A login when the content must stay private.
Google also says a noindex line inside robots.txt is not supported.
How the robots.txt syntax works
A robots.txt file is a list of groups. Each group starts with one or more User-agent lines naming crawlers. Allow and Disallow lines follow, each with a path.
Google’s robots.txt specification fills in the details:
- Google supports four fields: user-agent, allow, disallow and sitemap. It says other fields “such as crawl-delay” are not supported.
- Paths start with a slash and are case-sensitive. /Events/ and /events/ are different.
- An asterisk matches any characters. A dollar sign marks the end of a URL.
- When two rules conflict, Google uses the least restrictive one.
- Google reads only the first 500 KiB of the file.
- The file covers one host, protocol and port. A subdomain such as give.example.org needs its own file.
That matters for associations. Donation, store and community platforms often run on their own subdomains.
Google ignores Crawl-delay. Anthropic and Common Crawl say they honor it.
A commented sample robots.txt for example.org
This sample is for a WordPress site at example.org. It skips the admin area, opts out of AI training and leaves search crawlers alone. Lines starting with a hash are comments.
# robots.txt for https://www.example.org
# These are requests. They do not hide or protect anything.
# Default group: any crawler not named below
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
# AI training opt-outs. None of these affect search.
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: CCBot
Disallow: /
Sitemap: https://www.example.org/sitemap.xml
A crawler named in its own group skips the "*" group, so repeat the admin rules in any group you add for a search crawler. And a Disallow for OAI-SearchBot or PerplexityBot takes you out of that company’s AI search results.
Common robots.txt mistakes on nonprofit sites
Blocking CSS and JavaScript. Google says you can block unimportant resource files. But if missing files make a page harder for its crawler to understand, Google says not to block them. Leave CSS and JavaScript open.
Blocking staging the wrong way. A staging site with "Disallow: /" can still get URLs indexed through links. Worse, the file can ship to production with the next deploy and pull the live site out of search. Put staging behind a password instead. Google’s robots.txt guide names password protection as a way to keep pages out of results.
Using it to hide private pages. Listing /members-only/ or /board-documents/ tells everyone where those folders are. Use a login.
Forgetting subdomains. The main site may be fine while the event or giving subdomain blocks everything.
Letting a CDN or plugin edit it without telling anyone. Cloudflare’s September 15, 2026 blog post says its Bot Preference Sync "publishes the applicable no-training preference in robots.txt." See our posts on Cloudflare’s BotBase crawler registry and the Cloudflare AI crawler default change. Check the live file, not only your repo copy.
Robots.txt defaults in WordPress and Drupal
WordPress. WordPress serves a virtual robots.txt through its do_robots() function when no physical file exists. The default output is a "*" group that disallows /wp-admin/ and allows admin-ajax.php. Since WordPress 5.5, core adds a Sitemap line for public sites. The "Discourage search engines" setting no longer adds "Disallow: /". WordPress 5.3 moved it to a noindex robots meta tag instead. SEO plugins can change it through the robots_txt filter.
Drupal. Drupal ships a physical robots.txt file in the web root. It disallows /core/ and /profiles/ but allows CSS, JavaScript and image files inside them. It also blocks paths such as /admin/, /user/login and /search/, with matching /index.php/ versions.
The catch is Composer. Drupal’s scaffold plugin README says scaffold files "overwrite whatever content exists at the target location." A hand edit to robots.txt can vanish after the next composer update. The README recommends an append file in composer.json. Setting the file to false also works, but your project then stops getting core updates to it.
If a Drupal 10 site is still on your list, see what Drupal 10 end of life means for your site and our plain-language guide to the Webform advisories.
AI crawler user agents, as of October 2026
From each company’s own documentation, checked in October 2026. These change, so recheck before you edit.
| Token | Company | Purpose, per the company | Effect of blocking, per the company |
|---|---|---|---|
| Googlebot | Crawls for Google Search, Images, News and Discover | No Search crawling; AI Overviews draw on Search | |
| Google-Extended | Control token only; no separate crawler | Opts out of Gemini training and grounding; no effect on Search | |
| GPTBot | OpenAI | Crawls for model training | Content should not be used for training |
| OAI-SearchBot | OpenAI | Crawls for ChatGPT search | Not shown in ChatGPT search answers |
| ChatGPT-User | OpenAI | Visits pages when a user asks | Robots.txt rules may not apply |
| ClaudeBot | Anthropic | Collects content for model training | Future content excluded from training |
| Claude-SearchBot | Anthropic | Indexes content for search | May reduce visibility in search results |
| Claude-User | Anthropic | Fetches pages for a user’s question | Content not retrieved for user queries |
| PerplexityBot | Perplexity | Surfaces sites in Perplexity search; not for training | Site may not appear in Perplexity results |
| Perplexity-User | Perplexity | Fetches pages for user actions | Generally ignores robots.txt |
| Applebot-Extended | Apple | Control token for training Apple’s models; does not crawl | Pages can still appear in Apple search features |
| CCBot | Common Crawl | Builds an open archive of web crawl data | Stops future crawls |
Sources: Google’s common crawlers list, OpenAI’s crawler overview, Anthropic’s crawler article, Perplexity’s crawler page, Apple’s Applebot page and Common Crawl’s FAQ.
Training, search and user fetches: what to allow
Training crawlers and tokens. GPTBot, ClaudeBot, Google-Extended, Applebot-Extended and CCBot. Blocking them is a choice about reuse. Google says Google-Extended "does not impact a site’s inclusion in Google Search." Apple says pages that disallow Applebot-Extended "can still be included in search results." Common Crawl’s FAQ does not say whether blocking removes pages already in past archives.
Search crawlers. Googlebot, OAI-SearchBot, Claude-SearchBot and PerplexityBot. Blocking them removes you from, or reduces your visibility in, that company’s search answers. OpenAI says opted-out sites "will not be shown in ChatGPT search answers," though they can still appear as navigational links. OpenAI says changes take about 24 hours; Perplexity says up to 24 hours.
User-triggered fetchers. ChatGPT-User, Claude-User and Perplexity-User. OpenAI says robots.txt rules may not apply to ChatGPT-User. Perplexity says its user fetcher "generally ignores robots.txt rules." Google says the same of its user-triggered fetchers. Anthropic says its bots honor robots.txt. To control agents reliably, use firewall or bot settings, as we described in AI shopping agents getting blocked.
For most nonprofits and associations, allow search crawlers and treat training as a policy decision. Our AI crawler access audit shows how to see which crawlers you are blocking today, including blocks set at the CDN.
How to test your robots.txt
Load yourdomain.org/robots.txt in a browser, then each subdomain. That is what crawlers see.
Then check Google’s view. The robots.txt report in Search Console lists the files Google found for your top 20 hosts. It shows the last fetch time and any parsing errors, and you can request a recrawl after a fix. The report works only for domain-level properties. Our Search Console guide for beginners covers setting one up.
Review the file after every CMS update, plugin change or CDN setting change.
Frequently Asked Questions
What is a robots.txt file?
A plain text file at a site’s root that asks crawlers not to fetch certain URLs, as defined in RFC 9309. Crawlers can ignore it.
Does robots.txt keep a page out of Google?
No. Google says a disallowed page can still be indexed if other sites link to it. Use a noindex meta tag or header, and do not block that page in robots.txt, or Google will never see the noindex.
Does blocking GPTBot remove us from ChatGPT search?
No. OpenAI treats GPTBot (training) and OAI-SearchBot (search) as separate settings. Block GPTBot and allow OAI-SearchBot to stay in ChatGPT search answers while opting out of training.
Does blocking Google-Extended hurt our Google rankings?
Google says Google-Extended does not affect inclusion in Google Search and is not a ranking signal. It controls use for Gemini training and grounding.
Should we block AI crawlers entirely?
That is a policy choice. Blocking training crawlers does not affect search, per Google, OpenAI and Apple. Blocking search crawlers such as OAI-SearchBot, Claude-SearchBot or PerplexityBot removes you from those AI search answers.
Why did my robots.txt edits disappear on Drupal?
Drupal’s Composer scaffold plugin overwrites robots.txt by default. Use an append file in composer.json instead.
Where does WordPress keep its robots.txt?
If there is no physical file, WordPress generates one on request through do_robots(). Plugins can change it with the robots_txt filter. Load yourdomain.org/robots.txt to see the live version.
Do subdomains need their own robots.txt?
Yes. Google says a robots.txt file applies only to its own host, protocol and port. A giving or events subdomain needs its own file.