Guide 19 · How-to

WordPress robots.txt for AI bots: three files you can copy

Short answer. If you want to show up in ChatGPT, Claude and Perplexity answers but keep your content out of AI training, you do not need to name the search bots at all. Leave WordPress’s default rules for everyone, and add one group that turns away the training crawlers. Paste it in Rank Math, Yoast or All in One SEO, then open yoursite.com/robots.txt to check it.

Where does WordPress’s robots.txt come from?

WordPress has no robots.txt file on disk by default. It builds one on the fly when someone asks for /robots.txt. SEO plugins edit that built file.

If a real robots.txt file sits in your site’s root folder, the server sends that file instead, and your plugin’s editor stops working. Rank Math shows a “not writable” notice in that case. So if your edits never show up, look for a physical file first in your host’s file manager.

Which file should you use?

Which one fits depends on what you sell. If your content is the product (news, courses, paid research), File A keeps it out of training sets. If you want AI models to know your brand, your products or your expertise, File B keeps every door open. Pick one of the three. Replace example.com with your address. If you use Yoast or Rank Math, your sitemap is usually at /sitemap_index.xml.

File A: allow AI search, opt out of AI training

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: meta-externalagent
Disallow: /

Sitemap: https://example.com/sitemap_index.xml

OAI-SearchBot, Claude-SearchBot, PerplexityBot, Googlebot and Bingbot are not named, so they follow the first group and can read everything except the admin area.

Blocking Google-Extended does not remove you from Google Search or change your ranking, Google says. Blocking Applebot-Extended does not remove you from Apple’s search results either. Both only cover use in model training.

One judgment call: meta-externalagent. Meta says it crawls for training and also for “improving products by indexing content directly”, so blocking it may keep you out of Meta AI answers too. In our logs it read more real pages than any other AI bot. Delete that line if Meta AI matters to you.

File B: allow everything

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://example.com/sitemap_index.xml

This is close to what WordPress serves by default. Every AI bot can read your public pages.

File C: block all AI bots, keep Google and Bing search

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

User-agent: GPTBot
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: ClaudeBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: meta-externalagent
Disallow: /

Sitemap: https://example.com/sitemap_index.xml

Expect to drop out of ChatGPT, Claude and Perplexity answers. Some of these names fetch pages only when a person asks, and their owners say robots.txt may not apply to them, so this file is a request, not a lock.

For what each bot does, see GPTBot vs OAI-SearchBot vs ChatGPT-User.

What is the most common robots.txt mistake with AI bots?

Giving a bot its own group “to be safe”. A crawler that finds a group with its own name ignores the User-agent: * group completely. That is the rule in the robots.txt standard (RFC 9309).

So this looks harmless but is not:

User-agent: *
Disallow: /wp-admin/

User-agent: OAI-SearchBot
Allow: /

OAI-SearchBot now follows only its own group, so /wp-admin/ is open to it. If you do name a bot, repeat every rule it still needs inside its own group. The simpler fix is File A: don’t name the bots you allow.

You can list several bots on separate User-agent lines above one set of rules, as in Files A and C. They all share those rules.

How do you edit robots.txt in Rank Math, Yoast or All in One SEO?

Rank Math. Rank Math SEO › General Settings › Edit robots.txt. If you don’t see it, switch Rank Math to Advanced Mode. Paste, then Save Changes.

Yoast SEO. Yoast SEO › Tools › File editor. Click “Create robots.txt file” if there isn’t one yet, paste, save. Yoast SEO Premium also has toggles under Settings › Advanced › Crawl optimization › Block unwanted bots for Google AdsBot, Google-Extended, GPTBot and CCBot. Those are all training or ads bots, so they will not take you out of AI search.

All in One SEO. All in One SEO › Tools › Robots.txt Editor. Turn on “Enable Custom Robots.txt”, then add rules or use Import to paste a file. It also has a “Block AI Crawlers” list with an “All AI Crawlers” option. Read which names it adds before you tick it. If it includes OAI-SearchBot, Claude-SearchBot or PerplexityBot, you are blocking AI search too, not only training.

No SEO plugin. Create a plain text file called robots.txt, paste one of the files above, and upload it to the folder that holds wp-config.php.

How long until the bots follow the new file?

About a day. OpenAI says about 24 hours for OAI-SearchBot. Perplexity and Meta say up to 24 hours. The robots.txt standard lets crawlers keep a cached copy for up to 24 hours.

In our logs from four WordPress sites, OpenAI’s search crawler asked for robots.txt far more often than for any page. It checks permission often, so a change gets noticed.

How do you check it worked?

  1. Open yoursite.com/robots.txt in a private window. If you use a page cache or a CDN, purge it first. You should see exactly what you pasted.
  2. Run the AI crawler checker on your address. It reads your robots.txt the way each bot does and also sends a real request, so it catches a firewall that blocks a bot your file allows.
  3. To see which bots actually come, install our free plugin, Softrecs AI Crawler Checker. It logs AI bot visits and the addresses they asked for.

What robots.txt cannot do

  • It does not stop anyone. It is a request that honest crawlers follow. Scanners using a fake bot name ignore it, and we saw plenty of those.
  • It does not remove pages that are already in a search index or a training set. It affects crawling from now on.
  • Blocking a bot by IP in your firewall can backfire. Anthropic warns that it may stop their crawler from reading your robots.txt at all.
  • It is not llms.txt. That file is a different idea, and no major engine has said it reads it.

How this was made: bot names, robots.txt behaviour and timings checked against OpenAI, Anthropic, Perplexity, Google, Apple and Meta documentation and RFC 9309 on 16 November 2026; plugin screens from Rank Math, Yoast and All in One SEO documentation. Drafted with an AI assistant (Claude) and reviewed by Alauddin Chowdhury. Method and AI use.


Not sure what your site lets in?

Run the AI crawler checker on your address. It reads your robots.txt as each bot does and sends a real request, so it also catches firewall blocks.