Platform guide

WordPress robots.txt for AI Crawlers: How to Allow or Block Them

WordPress usually serves a virtual robots.txt that it or an SEO plugin generates, so there may be no file to edit. Read yourdomain.com/robots.txt to see the live rules, then check the places that can block AI bots even when robots.txt allows them.

Run the free GEO auditLast updated

Where Your WordPress robots.txt Comes From

Your robots.txt comes from one of three places: a physical file in the site's root folder, a virtual file that WordPress generates, or one managed by an SEO plugin. A physical file takes priority over a virtual one, and a plugin can overwrite manual edits, so find out which applies before you change anything.

Open yourdomain.com/robots.txt in a browser. That is the file crawlers read. Editing something else, such as a copy that your SEO plugin no longer serves, changes nothing. This is the most common reason people say "I edited it and nothing happened".

A fresh WordPress install with no plugin serves a very short virtual file: it blocks /wp-admin/ and allows admin-ajax.php. It does not name any AI bot, so by default none is blocked from this file.

What Can Block AI Bots on WordPress

Five places can block an AI bot on a WordPress site, and robots.txt is only the first. Check them in order.

Where a WordPress site can block AI crawlers
WhereHow it blocksHow to check
robots.txtDisallow lines for named bots, or for everyoneOpen /robots.txt and read it
Search engine visibility settingThe Discourage search engines option in Settings, Reading adds a noindex signal and can change robots.txt. It is meant for sites under constructionCheck that it is unticked on a live site
SEO or AI-blocking pluginSome plugins add AI bot rules to robots.txt or headers with one switchReview the plugin's bot or crawler settings
Security plugin or firewallRate limits or bot rules can return 403 or 429 to crawlersTest as the bot to see the status code
Host or CDNHosting firewalls and CDNs such as Cloudflare can block by user agentSee [Cloudflare blocking AI bots](/geo/cloudflare-blocking-ai-bots)

Editing robots.txt in Yoast, Rank Math and AIOSEO

Each big SEO plugin has its own robots.txt editor, and they are in different places. If one of them is active on your site, edit it there and nowhere else.

Where the common plugins keep the robots.txt editor
PluginWhere to look
Yoast SEOYoast SEO, Tools, File editor
Rank MathRank Math, General Settings, Edit robots.txt
All in One SEOAll in One SEO, Tools, Robots.txt Editor
No SEO pluginUpload a robots.txt file to the site root with your host's file manager or SFTP

Plugin menus move between versions, so treat these paths as a starting point and search the plugin's own documentation if you do not see them. After saving, reload yourdomain.com/robots.txt. If the new rules are not there, a cache plugin or a physical file is getting in the way. Clear the cache first.

How to Allow the AI Bots You Want

Remove any rule that blocks a bot you want, using the same tool that created it. For visibility in AI search, the bots that matter are the search ones. Add them explicitly if you like, so the intent is clear to whoever edits the file next.

User-agent: OAI-SearchBot
Allow: /

User-agent: Claude-SearchBot
Allow: /

User-agent: PerplexityBot
Allow: /

Keep wp-admin and other private paths blocked for all bots. The robots.txt guide explains how Allow and Disallow groups combine and which bots do what, and the GPTBot guide covers OpenAI's three crawlers.

Blocking Training Bots Without Hiding From AI Search

Many WordPress owners want to be found in ChatGPT or Claude answers but do not want their writing used for model training. Those are separate bots, so you can treat them separately.

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

Several plugins offer an "AI bots" toggle that adds rules like these. It is convenient, but open the resulting robots.txt and read it. A toggle that is too broad can shut out the search bots too. Remember that robots.txt is a request. Well-behaved crawlers follow it, and it does not remove anything already collected.

Security Plugins and Hosts That Say No

Security plugins such as Wordfence, and the firewalls many hosts run, look at traffic patterns. A crawler that requests many pages quickly can look like an attack and get a 403 or 429 response. Your robots.txt can say yes while the server says no.

  • Check the plugin's rate limiting and "block fake crawlers" style settings and loosen them for known search bots.
  • Ask your host whether a server-level bot filter is on. Some managed hosts enable one by default.
  • If the domain uses Cloudflare, look at its AI crawler controls too. Cloudflare began blocking known AI crawlers by default for new domains in July 2025, and owners can change that.

Do not allow-list by trusting the user agent alone, because anyone can fake it. Where the bot publishes IP ranges, allow those.

Verify With a Real Request

After changing anything, run the free GeoLint audit on your homepage. A clean robots.txt is not proof that a security plugin or your host lets the bot through, and the audit shows the real status code for each AI search bot.

Run it again after plugin updates, since a new version can reset settings. If the audit finds a block you cannot locate, or you would rather not edit server rules yourself, see what the done-for-you fix includes.

WordPress and AI Crawlers: Common Questions

Does WordPress block AI bots by default?

WordPress itself does not name AI bots in its default robots.txt. A plugin, a security setting, the Discourage search engines option or your host can still block them, so read your live robots.txt and test the page.

Why is my WordPress robots.txt not changing when I edit it?

Another source is probably serving it. A physical file overrides the virtual one, and an SEO plugin can regenerate its own. A cache can also serve the old copy. Find which one produces the file at /robots.txt and edit that.

Where do I edit robots.txt in Yoast or Rank Math?

In Yoast it is under Tools, File editor. In Rank Math it is under General Settings, Edit robots.txt. Menus change between versions, so check the plugin documentation if you cannot find it.

Is there a plugin to block AI crawlers?

Yes, several plugins add AI bot rules with one setting. Be careful that they do not also block the search bots you want. Check the resulting robots.txt after enabling one.

Does the Discourage search engines setting block AI bots?

It asks search engines not to index the site, and it can change robots.txt. It is meant for sites under construction. On a live site it should be off if you want to be found by search or AI tools.

My robots.txt allows the bots but they still cannot read my site. Why?

A security plugin, host firewall or CDN is likely returning 403 or 429. Test the page as each bot and read the status code. That shows which layer is refusing the request.

Can I block AI training but stay visible in AI search?

Yes. Disallow training bots such as GPTBot and ClaudeBot, and allow search bots such as OAI-SearchBot and Claude-SearchBot. Robots.txt is a request that polite crawlers follow, not a technical barrier.

Check your own website for free

GeoLint asks each AI search bot for your page, loads it with and without JavaScript and shows what is blocking you. It is free, needs no signup and takes about 20 seconds.