Short answer: block GPTBot and allow OAI-SearchBot. OpenAI documents them as separate agents with separate jobs; blocking the training crawler alone does not remove you from ChatGPT's search results.
Why this is worth getting right
Most sites that block AI crawlers are making a decision about training data. That is a legitimate position with a real rationale. The problem is that the rule people write also blocks the agent that decides whether they appear in answers — and the cost never shows up as an error. You just stop being an option.
A file that separates the two decisions
# Training corpora: declined.
# Reason: our position on content used for model training. Reviewed 2026-09.
User-agent: GPTBot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: CCBot
Disallow: /
# Retrieval and answer surfaces: allowed.
# Blocking these removes us from answers; that is not the intent.
User-agent: OAI-SearchBot
Allow: /
User-agent: PerplexityBot
Allow: /
User-agent: Claude-SearchBot
Allow: /
User-agent: Applebot
Allow: /Two notes on the shape of that file. Comments matter more than they look — in a year, whoever reads it will not remember which line was deliberate, and an unexplained Disallow tends to get copied forward forever. And do not add agents you have not verified: inventing a user-agent name is worse than leaving a gap, because site owners will write rules against a name nothing honours and believe they have allowed something.
The agents that ignore robots.txt on purpose
Some user-triggered fetchers are documented as generally not following robots.txt, because the request came from a person rather than a scheduled crawl — Claude-User and Perplexity-User are both documented this way. You cannot control these with robots.txt. If you need to, that is an edge-rule decision, and you should understand that it fails a request a real person made.
Verify it
A robots.txt reading tells you your intent. Fetching as each agent tells you your behaviour. Only the second one is evidence.