AgentCan
← All checks

How to allow or disallow GPTBot in robots.txt

A robots.txt rule for GPTBot takes two lines, and most of the ways to get it wrong come from what surrounds those lines: a missing blank line, a misspelled name, a path that matches more than you meant. Below are four blocks you can paste as they are, with a note on what each one does and what it leaves alone.

GPTBot is one crawler, not all of OpenAI

OpenAI's bots documentation lists GPTBot as the crawler for training and OAI-SearchBot as the crawler for search. They are separate groups in robots.txt. A rule for GPTBot says nothing about OAI-SearchBot, and the other way round.

A group is a User-agent: line followed by the rules for that name. Groups are separated by an empty line. If you write two groups with no blank line between them, you risk the parser reading them as one.

The name after User-agent: has to match what the crawler looks for. A typo such as GPT-Bot or GPTbot with stray characters gives you a group that no crawler uses. The bot then falls back to the * group, and your rule does nothing without any error to tell you so.

Check it by hand

Block GPTBot completely

This is the shortest rule. Disallow: / matches every path on the site, so GPTBot is asked to fetch nothing. Paste it at the end of your robots.txt, after an empty line.

It covers GPTBot only. Other crawlers, including OAI-SearchBot, keep following their own groups or the * group.

Check it by hand

User-agent: GPTBot
Disallow: /

Block part of the site

Paths match by prefix. Disallow: /private/ covers /private/, /private/report.html and everything below it. Disallow: /private without the slash would also cover /private-notes, which you may not want.

To open one page inside a closed folder, add an Allow: line with the longer path. The more specific rule is the one meant to win.

Remember that a group naming a bot replaces the * group for that bot. If your * group has rules you still want GPTBot to follow, repeat them inside the GPTBot group.

Check it by hand

User-agent: GPTBot
Disallow: /private/
Allow: /private/public-page

Block training, keep search

If you want to stay out of training data but still be findable in search, give each crawler its own group. GPTBot is closed, and OAI-SearchBot is allowed by name instead of by silence.

Naming OAI-SearchBot explicitly makes the intent readable to the next person who opens the file, and it protects you if the * group is later tightened.

Check it by hand

User-agent: GPTBot
Disallow: /

User-agent: OAI-SearchBot
Allow: /

Allow GPTBot explicitly

If nothing blocks GPTBot, you do not need a group for it. Still, an explicit group is useful when your * group is restrictive and you want one named exception.

An empty Disallow: with no path means everything is allowed. Allow: / says the same thing more clearly, so prefer it when you write the file for people to read.

Check it by hand

User-agent: GPTBot
Allow: /

Questions

Does a GPTBot group replace the `*` group?
Yes, for GPTBot. A bot follows the most specific group that names it and ignores the * group. Repeat any path rules you still need inside the GPTBot group.

What does an empty `Disallow:` do?
It means nothing is disallowed, so everything is allowed. Disallow: / is the opposite: it blocks the whole site. One slash changes the meaning completely, so read that line twice.

Does robots.txt block GPTBot at the CDN or firewall?
No. Robots.txt states intent and is read by the crawler. Your CDN or WAF does not read it, so a bot can still receive a 403, a challenge page or a normal 200 whatever the file says. The guide on why ChatGPT can't see a site covers this in its first section.

Will pages GPTBot already fetched be removed?
Not by robots.txt. The file controls what a crawler is asked to fetch from now on. It does not reach back into content that was already collected, and we cannot tell from outside what any crawler has stored.

Check your site free

Related checks

All checks

AgentCan scores a site at one moment; it is not a guarantee about how every agent will treat it.