When you host your own site, there is no platform standing between you and robots.txt. You own the server, so you own the file. That freedom removes every platform quirk, and it replaces them with one responsibility: whatever sits on disk is exactly what crawlers will read.

A plain file, and three places it can go wrong

Create or edit robots.txt in your web server's document root as plain text, and it will be served at yourdomain.com/robots.txt, using your real domain, on the next request. No panel, no template, and no plugin are involved. The file itself is the configuration.

That directness also gives you checks that hosted platforms cannot offer. You can fetch the file yourself, request a page while pretending to be a crawler to confirm the outer layer lets it through, search your access logs for crawler names, and compare real visits against the vendors' published address ranges.

But a correct file on disk is not the same as a correct file served to crawlers, and three things can separate them. First, your server settings can take over the robots.txt address. An nginx location block or an Apache rewrite that handles that address can serve something else entirely. Second, a content delivery network can hold an old copy in cache long after you edited the file. Third, if you run several servers behind a load balancer, the file can drift apart across them, so different crawlers receive different rules.

The fix for the third problem is to serve the file from your deploy pipeline, so every server gets the same version and it cannot drift.

The steps

First, see what the world sees today. In a terminal, run this command, using your real domain:

code
curl https://[yourdomain.com]/robots.txt

Read the rules that come back.

Second, edit the file in the document root. Open robots.txt in your web server's document root, for example /var/www/html/robots.txt on a typical nginx or Apache setup, in a plain text editor. When no file is present, make a new one. Save it as plain text with UTF-8 encoding.

Third, put the AI crawler groups high in the file, ahead of any broad block rules:

code
User-agent: OAI-SearchBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: Claude-SearchBot
Allow: /

User-agent: Claude-User
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: meta-webindexer
Allow: /

User-agent: bingbot
Allow: /

One limit to know: ChatGPT-User only shows up when a person asks ChatGPT to look at a page. Your allow line gives it permission, but it cannot steer a fetcher that pays no attention to robots.txt.

Fourth, verify the served file, not just the file on disk. Fetch the address again with curl and confirm the new groups appear. Check that the content type is text/plain. If you use a content delivery network, clear its cache for the robots.txt address, or wait for the cache lifetime to expire.

Give it a week, then look for proof in your access logs. Search for the crawler names. No visits at all means something upstream is still blocking them, no matter what the file says.

The cache that outlived the edit

Imagine a business running help documentation on its own server, behind a content delivery network. The team writes the file perfectly and confirms it on disk. A month later, a scan still shows AI crawlers receiving the old rules. The network had cached the robots.txt address with a long lifetime and never picked up the change. One cache purge fixed it.

On a self-hosted setup, writing the file is the easy part. The cache and server settings in front of it are the parts that bite.

The file alone is not the whole story

Robots.txt states what you intend. It cannot force a result. If your own firewall or content delivery network stops an AI crawler before it reads the file, your allow rules never get a chance to matter. You configured that outer layer yourself, so you can also check it, and keeping an eye on it over time sits outside this edit.

Frequently Asked Questions

I edited the file on disk, but the address still shows old rules. Why?

Usually a server setting or a cache is in the way. A location block or rewrite can take over the address, or a content delivery network can serve a cached copy. Fix the setting or clear the cache, then fetch the address again.

How do I know crawlers are actually visiting?

Search your access logs for the crawler names after a week. No visits means something upstream is still blocking them, no matter what the file says.

I run a load balancer. What should I watch for?

Every server needs the same file. Better still, serve it from your deploy pipeline, so the copies cannot drift apart.

What format should the file use?

Plain text with UTF-8 encoding, served with a text/plain content type.

Verified Sources & Technical Documentation

links marked specific point to the page that supports the claim in this guide. Links marked general docs point to the vendor's general docs section for that topic, not to a page that proves every step. Check the vendor docs for the current path before relying on a menu name or click path in this guide.