Sub topic 1
How robots.txt works
Prerequisites
This chapter assumes you know how search engine crawlers fetch pages, what an HTTP User-Agent header is, and how to edit files at your site's root. You should also be comfortable reading a short command-line example.
How robots.txt works
A crawler is a program that downloads web pages. Before fetching pages, a well-behaved crawler requests /robots.txt from your host. This file follows the Robots Exclusion Protocol, which groups rules under a User-agent line. Each group names a crawler token and lists Allow or Disallow paths. A crawler uses the most specific matching group, and any path not matched by a Disallow rule is allowed.
User-agent: GPTBot
Disallow: /drafts/
User-agent: *
Allow: /Training, AI search, and user-initiated fetches
AI-related crawlers serve three purposes:
- Training: the crawler collects content to train a model.
- AI search: the crawler indexes pages so an AI search product can cite them.
- User-initiated fetching: a tool downloads a page because a person asked a chatbot to read it.
Each purpose has its own token, so you can allow one and block another.
flowchart TD
A[AI-related request] --> B{Purpose?}
B -->|Training| C[Block or allow GPTBot, Google-Extended, ClaudeBot]
B -->|AI search| D[Allow or block OAI-SearchBot]
B -->|User request| E[Allow or block ChatGPT-User]caption: Three purposes for AI crawler traffic and the tokens that control each. alt: A flowchart that starts at an AI-related request, branches by purpose into training, AI search, or user request, and lists the matching robots.txt tokens under each branch.
OpenAI's three user agents
OpenAI uses three tokens:
GPTBotcollects content for training.OAI-SearchBotindexes pages for ChatGPT search results.ChatGPT-Userfetches a page when a user asks ChatGPT to open it.
Blocking GPTBot does not block OAI-SearchBot or ChatGPT-User. Each needs its own group.
Google-Extended: what it controls and what it does not
Google-Extended is a robots.txt token that controls whether content Google has crawled may be used to train Gemini models and ground its AI features. It does not stop Googlebot from crawling your pages. Search ranking and indexing still depend on Googlebot, so blocking Google-Extended leaves your search visibility unchanged.
User-agent: Google-Extended
Disallow: /> Note: this exercise is a self-check on the distinction above.
Exercise
If a robots.txt file contains only "User-agent: Google-Extended" with "Disallow: /", does Google Search stop indexing your pages?
Show answer
No. Google-Extended controls AI training and grounding use only. Googlebot, which handles Search indexing, is not affected.