How does robots.txt block GPTBot?
On this page
Short Answer: Using "GPTBot" as the User-agent in robots.txt and setting a "Disallow" rule expresses your preference that GPTBot not crawl your website’s content. This applies only to GPTBot and does not automatically manage other OpenAI crawlers for you.
Basic Syntax
User-agent: GPTBot
Disallow: /If you want to restrict access to a specific directory, include the path after “Disallow,” such as /private/. After deployment, verify that the file is accessible from the site’s root directory, and ensure the rule spelling and path match the target.
First, distinguish the targets
OpenAI uses GPTBot for data collection that may be used in model training; OAI-SearchBot is used for ChatGPT search results; and ChatGPT-User corresponds to page visits initiated by users. The purposes and control methods for these three are different. The OpenAI crawler documentation provides the current definitions. This article explains how to configure `robots.txt`; it does not guarantee that it can restrict all unauthorized access.
Pre- and Post-Deployment Checks
The robots.txt file is a plain-text ruleset placed in the site’s root directory. To verify, first open the target site’s /robots.txt file in a browser or via the command line to confirm that the server returns the expected file—not the homepage HTML, a cached version, or an error page. Next, verify the User-agent groups and Disallow paths where the rules apply; the scope of rule matching is determined by the path and cannot be judged solely by the presence of the term “GPTBot” in the file.
After updating, monitor subsequent requests from the target User-agent in the access logs and verify the source based on the public IP range. Logs are used to troubleshoot requests and assess the effectiveness of the configuration; whether the site is being crawled must be determined separately using crawl logs. The OpenAI documentation also notes that changes to robots.txt take time to propagate through its search system. Relevant records should specify the time of the change; do not mistake the short window immediately after deployment for the final state.
Block only expressions used during training
If your site’s policy is simply to prevent GPTBot from crawling content, do not indiscriminately apply the same `Disallow` rule to all OpenAI user-agents. List GPTBot and OAI-SearchBot in separate groups, and specify the purpose of each group in comments or internal records. This way, future maintainers will understand why one type of access is allowed while another is blocked.
Before deployment, verify the rule text in a test file, then publish the updates to the root directory and clear any existing caches. Record the publication date, and wait for the service provider to update their system according to their instructions before verifying the logs. If you also need to block public access to pages, use technical measures such as site authentication; the robots.txt file is intended solely to express crawling preferences for bots.
Continue reading: Read the related GEO Guide chapter →