
robots.txt for AI – How to Control Artificial Intelligence Crawlers on Your Site
The file robots.txt has existed for decades. It was created to tell Googlebot and other search engine crawlers what they can and cannot index on your site. For years, it was a simple file with a simple function. That simplicity is over. Today, your robots.txt is visited by crawlers from dozens of artificial intelligence systems – OpenAI’s GPTBot, Anthropic’s ClaudeBot, Google’s Google-Extended, PerplexityBot, Meta-ExternalAgent and many others. Each of them uses your site’s content to train models or to generate answers in real time. And most Portuguese sites have no instructions for any of them. In this article I explain how robots.txt for AI crawlers works, which user-agents are the most relevant, how to block or allow selectively, and how this decision fits into your artificial intelligence optimization.
What robots.txt is and how it works
The robots.txt is a plain text file placed in the root of your site (for example, heldermesquita.pt/robots.txt) that follows the Robots Exclusion Protocol – a convention created in 1994 that defines how crawlers should behave when they visit a site. The structure is simple: you identify an agent (User-agent) and define what is allowed (Allow) or forbidden (Disallow). The critical point that many people forget: robots.txt is not a security mechanism. It is a courtesy instruction – a well-behaved crawler respects it, but a malicious crawler ignores it completely. The crawlers of the big AI systems (OpenAI, Anthropic, Google, Meta) respect robots.txt. Generic scraping crawlers may not.
Why robots.txt for AI is different from robots.txt for SEO
When you configure robots.txt for Google, the goal is to control what is indexed in search results and to avoid duplicate content, protect private areas and manage crawl budget. When you configure robots.txt for AI crawlers, the context is completely different. You are deciding whether your content can be used to:
- Train language models – the crawler visits the site, extracts text, and that text enters the training dataset of a new version of the model
- Generate answers in real time – the crawler visits the site at the moment a user asks a question, and uses the content to build the answer (RAG)
- Feed AI search indexes – such as Perplexity or ChatGPT Search, which build their own indexes of web content
These are three distinct use cases, with different implications for your strategy. And you can control each of them independently, if you know the right user-agents.
The main AI crawlers and their user-agents
Here are the most relevant AI crawlers you may find in your robots.txt:
| System | User-agent | Company | Main use |
|---|---|---|---|
| ChatGPT / OpenAI | GPTBot |
OpenAI | Model training + ChatGPT Search |
| ChatGPT Search | OAI-SearchBot |
OpenAI | Real-time web search in ChatGPT |
| Claude / Anthropic | ClaudeBot |
Anthropic | Model training + web search |
| Google AI / Bard / Gemini | Google-Extended |
Training of Gemini and Bard models | |
| Perplexity | PerplexityBot |
Perplexity AI | Real-time search index |
| Meta AI | Meta-ExternalAgent |
Meta | Training of Llama models |
| Apple | Applebot-Extended |
Apple | Training of Apple Intelligence models |
| Common Crawl | CCBot |
Common Crawl | Training dataset used by multiple models |
| Cohere | cohere-ai |
Cohere | Training of enterprise models |
| Amazon | Amazonbot |
Amazon | Training of Alexa and AWS models |
This list is not static – new AI crawlers appear regularly. It is good practice to review your robots.txt at least once per semester, and to check whether there are new user-agents relevant to your strategy.
Block or allow? The strategic decision
This is the question that most divides digital marketing professionals: should I block AI crawlers or let them through? There is no single answer. It depends on your goals. Here are the three most common scenarios:
Scenario 1 – Allow everything (visibility strategy)
If your goal is to be cited by AI systems and to appear in the answers of ChatGPT, Perplexity or Google AI Overview, the logic is permissive. You want crawlers to read your content, index it and use it as a source. In this case, the robots.txt for AI crawlers does not need anything special – the absence of blocking rules means everything is allowed by default. But you can be explicit with permissions to reinforce the signal. This is the recommended approach for most content creators, consultants, service professionals and companies that want to increase their visibility in AI search systems. It is also what the R.E.F.E.R.E.N.C.I.A. Method™ recommends as a starting point.
Scenario 2 – Block training, allow search (hybrid strategy)
Some content creators have a specific position: they do not want their work used to train AI models (for copyright reasons or editorial philosophy), but they accept that real-time search systems cite their pages. In this case, the configuration is surgical: you block the GPTBot (which is used for training) but allow the OAI-SearchBot (which is used for real-time search in ChatGPT). In the same way, you can block the Google-Extended without affecting the Googlebot crawler.
Scenario 3 – Block everything (protection strategy)
Press publications, publishers, sites with premium subscription content, and creators whose business model is based on exclusive content may prefer to block all AI crawlers. The risk of this approach is clear: you become invisible in AI search systems. While your competitors are cited by ChatGPT and Perplexity, your site does not appear. It is a conscious decision with direct consequences for visibility.
Practical robots.txt examples for AI
Configuration 1 – Allow all AI crawlers (recommended for visibility)
User-agent: * Disallow: User-agent: GPTBot Allow: / User-agent: OAI-SearchBot Allow: / User-agent: ClaudeBot Allow: / User-agent: Google-Extended Allow: / User-agent: PerplexityBot Allow: / User-agent: Meta-ExternalAgent Allow: / User-agent: Applebot-Extended Allow: / Sitemap: https://yoursite.com/sitemap_index.xml
Configuration 2 – Block training, allow real-time search
User-agent: * Disallow: # Training crawlers - blocked User-agent: GPTBot Disallow: / User-agent: Google-Extended Disallow: / User-agent: Meta-ExternalAgent Disallow: / User-agent: CCBot Disallow: / User-agent: cohere-ai Disallow: / User-agent: Amazonbot Disallow: / User-agent: Applebot-Extended Disallow: / # Real-time search crawlers - allowed User-agent: OAI-SearchBot Allow: / User-agent: PerplexityBot Allow: / Sitemap: https://yoursite.com/sitemap_index.xml
Configuration 3 – Block all AI crawlers
User-agent: * Disallow: User-agent: GPTBot Disallow: / User-agent: OAI-SearchBot Disallow: / User-agent: ClaudeBot Disallow: / User-agent: Google-Extended Disallow: / User-agent: PerplexityBot Disallow: / User-agent: Meta-ExternalAgent Disallow: / User-agent: CCBot Disallow: / User-agent: cohere-ai Disallow: / User-agent: Amazonbot Disallow: / User-agent: Applebot-Extended Disallow: / Sitemap: https://yoursite.com/sitemap_index.xml
Configuration 4 – Allow AI crawlers but protect premium content
User-agent: * Disallow: # Premium content - blocked for all User-agent: GPTBot Disallow: /members/ Disallow: /downloads/ Allow: / User-agent: ClaudeBot Disallow: /members/ Disallow: /downloads/ Allow: / User-agent: PerplexityBot Disallow: /members/ Disallow: /downloads/ Allow: / Sitemap: https://yoursite.com/sitemap_index.xml
How to edit robots.txt in WordPress
In WordPress, robots.txt can be managed in three ways:
Method 1 – Rank Math SEO (recommended)
Rank Math has a built-in robots.txt editor. Go to Rank Math → General → Edit robots.txt. Paste the rules directly into the editor and save. Rank Math manages the file without you needing FTP access.
Method 2 – Direct upload via FTP
If you prefer full control, create a file robots.txt with the content you want and upload it to the WordPress root, the same folder that contains wp-config.php and wp-login.php. Note: if WordPress already has a virtual robots.txt generated by the core, the physical file you upload takes precedence.
Method 3 – Yoast SEO
In Yoast, go to SEO → Tools → File editor
Edit robots.txt directly in the dashboard.
Checking that robots.txt is correct
After editing, go to https://yoursite.com/robots.txt in the browser and confirm that the rules are visible. You can also use Google Search Console → URL Inspection → to check whether Googlebot has access to the pages you want.
robots.txt, llms.txt and ai.json – how the three relate
The three files work in different, complementary layers:
- The robots.txt defines who can get in to your site and where. It is the gatekeeper – it controls access.
- The llms.txt
defines what matters most inside your site for an AI model. It is the editorial guide – it guides priority. - The ai.json
defines who you are as an entity. It is the ID card – it anchors your digital identity.
A site well prepared for AI has all three configured coherently. It makes no sense to have a llms.txt listing your most important pages if the robots.txt is blocking the crawlers that read that file. And it makes no sense to have an ai.json with your identity if models are not allowed to access your content. Coherence between the three is what makes the difference in the IPD-IA index and is exactly what the Technical Structure pillar of the R.E.F.E.R.E.N.C.I.A. Method™ covers in detail.
Frequently asked questions about robots.txt for AI crawlers
If I block GPTBot, does my site stop appearing in ChatGPT?
Blocking GPTBot prevents your content from being used to train future versions of OpenAI’s models. But ChatGPT Search uses the OAI-SearchBot – a different crawler. If you block GPTBot but leave OAI-SearchBot free, your site can still be cited in ChatGPT’s real-time searches, even though it does not enter the training data.
Does blocking Google-Extended affect my Google ranking?
Not directly. Google-Extended is a crawler specific to Google’s generative systems (Gemini, AI Overview). The classic Googlebot – which determines your ranking in organic search – is a different agent and is not affected. You can block Google-Extended with no impact on your traditional SEO.
Is robots.txt for AI required?
No. If you have no specific rule for AI crawlers, the default behavior is that everything is allowed, which, for most sites aiming for visibility, is the ideal configuration. robots.txt for AI is only required if you want to explicitly block or restrict access.
How do I know whether AI crawlers have already visited my site?
Through server logs. In cPanel or Plesk, go to the access logs and look for the user-agents listed in this article (GPTBot, ClaudeBot, PerplexityBot, etc.). Tools such as Cloudflare also show traffic by bot in their analytics. Most sites with public content already receive regular visits from at least two or three of these crawlers.
Can I block AI crawlers on only some pages?
Yes. robots.txt syntax lets you combine Allow and Disallow per user-agent with specific paths. For example, you can block GPTBot in the /downloads/ folder but allow access to the rest of the site. Configuration 4 in this article shows exactly how to do that.
Is robots.txt enough to protect my content from being used by AI?
For well-behaved crawlers such as those of OpenAI, Google, Anthropic and Meta – yes, they respect robots.txt. But third-party crawlers that do generic scraping may ignore it. If content protection is critical to your business model, robots.txt is necessary but not sufficient – you need other layers of protection such as authentication or paywalls.
Summary – what to do now
- Go to your robots.txt at
yoursite.com/robots.txtand see what is there - Decide your strategy: full visibility, hybrid or protection
- Choose the matching configuration in this article
- Edit robots.txt via Rank Math, Yoast or FTP
- Check the result by accessing
yoursite.com/robots.txtagain - Make sure the configuration is consistent with your llms.txt and ai.json
This configuration is one of the first checks of the IPD-IA audit, and one of the technical signals that is easiest to fix with immediate impact on your site’s readiness for artificial intelligence systems.
If you prefer that I handle robots.txt and the rest of the structure for you, see the GEO consulting service.
