AI search readiness · Website builders and CMSs
WordPress robots.txt, sitemap and llms.txt for AI search
Self-hosted WordPress serves a virtual robots.txt generated by PHP, not a file on disk. You can change it with the robots_txt filter, an SEO plugin's editor, or by uploading a real robots.txt to the site root, which overrides the virtual one. Since version 5.5 core publishes an XML sitemap index at /wp-sitemap.xml. llms.txt and rich schema come from plugins such as Yoast SEO and Rank Math.
- Edit robots.txt
- YesVirtual file built by do_robots(). Edit it with the robots_txt filter, the Yoast or Rank Math editor, or a physical robots.txt in the site root.
- XML sitemap
- YesCore sitemap index since WordPress 5.5. Yoast and Rank Math replace it with /sitemap_index.xml when their sitemaps are on.
/wp-sitemap.xml - llms.txt
- With a plugin or appNot in core. Yoast SEO (Settings > Site features > AI tools) and Rank Math (LLMS Txt module) generate /llms.txt, or upload a file to the web root.
- AI crawlers
- No AI-specific setting in core. The default virtual robots.txt only disallows /wp-admin/ for all user agents, so AI crawlers are allowed unless you add rules.
- Structured data
- Core documents no schema.org output. Yoast SEO adds a JSON-LD @graph (Organization or Person, WebSite, WebPage, plus Article on posts); Rank Math and themes add their own. Avoid running two schema plugins.
How WordPress serves robots.txt
A fresh WordPress install has no robots.txt on disk. When a crawler requests /robots.txt, WordPress runs the do_robots() function and prints a virtual file. Its default output is short:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/wp-sitemap.xml
The Sitemap line is added by the core sitemap feature introduced in WordPress 5.5. Nothing in the default file mentions AI crawlers, so GPTBot, ClaudeBot, PerplexityBot and the rest are allowed to crawl everything outside /wp-admin/.
One historical trap: before WordPress 5.3, ticking Settings > Reading > Search engine visibility ("Discourage search engines from indexing this site") changed the virtual file to Disallow: /. Since 5.3 it adds a noindex robots meta tag instead, and it switches off /wp-sitemap.xml. Either way it is the first thing to check when a live site is missing from search.
How to edit robots.txt in WordPress
There are three ways, and they interact. A physical file always wins.
- Upload a physical file. Create
robots.txtin the site root (the folder withwp-config.php) by SFTP or your host's file manager. The web server serves it directly and WordPress's virtual file is never generated. - Use an SEO plugin editor. In Yoast SEO go to Yoast SEO > Tools > File editor > Create robots.txt file. The menu is hidden when file editing is disabled, and the file must be writable. In Rank Math turn on Advanced Mode, then go to Rank Math SEO > General Settings > Edit robots.txt. Rank Math edits the virtual file, so if a physical robots.txt exists its changes do nothing until you delete that file.
- Use the
robots_txtfilter (available since WordPress 3.0). It receives the generated output and a flag for whether the site is public. This adds a rule without touching the defaults:
add_filter( 'robots_txt', function ( $output, $public ) {
$output .= "\nUser-agent: GPTBot\nDisallow: /\n";
return $output;
}, 10, 2 );
The filter only runs when there is no physical file. After any change, load yourdomain.com/robots.txt in a private window and run it through the robots.txt checker; page caches and CDNs sometimes keep serving the old version.
The WordPress sitemap
Core publishes a sitemap index at /wp-sitemap.xml. It covers public post types, public taxonomies, author archives and the homepage, with up to 2,000 URLs per sub-sitemap. Developers can turn it off with the wp_sitemaps_enabled filter or drop a post type with wp_sitemaps_post_types.
SEO plugins replace it. With Yoast's XML sitemaps toggle on (Yoast SEO > Settings > Site features), or with Rank Math's sitemap module, the index is /sitemap_index.xml. Yoast's spec also redirects /sitemap.xml to its index. Submit whichever URL your robots.txt lists in Google Search Console and Bing Webmaster Tools; a WordPress site that switched plugins often still has the old sitemap submitted. More on how sitemaps work: XML sitemap.
llms.txt and structured data
Core has no llms.txt feature. Yoast SEO generates one under Settings > Site features > AI tools > LLMS.txt (not available on multisite). Rank Math has an LLMS Txt module configured at General Settings > Edit llms.txt, which lists chosen post types and taxonomies up to a default limit of 100 entries and skips noindexed posts. Both plugins call llms.txt a proposal with limited adoption. See what llms.txt is before you spend time on it, and test the result with the llms.txt checker.
For schema, Yoast outputs a single JSON-LD @graph with Organization or Person, WebSite and WebPage nodes linked by @id; its blog post example adds Article and BreadcrumbList. Rank Math and many themes do the same job, so run one schema source, not two, or you will ship duplicate entities.
Check your WordPress site
Paste your domain to see which AI crawlers your live robots.txt lets in.
robots.txt checker
Test your robots.txt against every AI crawler
robots.txt generator
# robots.txt generated with https://www.getpicked.app/tools/robots-txt-checker
# Preset: Allow AI search, block training
User-agent: *
Allow: /
# Model training crawlers
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: Meta-ExternalAgent
User-agent: Amazonbot
User-agent: CCBot
User-agent: Bytespider
Disallow: /
Questions
- Where is the robots.txt file in WordPress?
- On a default install there is no file. WordPress answers requests for /robots.txt with a virtual file built by the do_robots() function. If you upload a real robots.txt to the folder that holds wp-config.php, the web server serves that file instead and the virtual one is ignored.
- Why can't Yoast or Rank Math change my robots.txt?
- Usually because a physical robots.txt already sits in the site root, which takes precedence over the virtual file. Rank Math says to delete the physical file first. Yoast needs file editing enabled and a writable robots.txt; if DISALLOW_FILE_EDIT is set, its File editor menu does not appear.
- What is the WordPress sitemap URL?
- WordPress 5.5 and later publish /wp-sitemap.xml. With Yoast or Rank Math sitemaps switched on, use /sitemap_index.xml instead. Check the Sitemap line in your live robots.txt to see which one your site advertises.
- Does Discourage search engines from indexing this site block crawlers in robots.txt?
- Not since WordPress 5.3. The setting now adds a noindex robots meta tag instead of a Disallow rule, and it also turns off the core sitemap. It is a request, not a block, and it is a common reason a live site disappears from search.
- Can WordPress serve an llms.txt file?
- Yes, through a plugin or a file upload. Yoast SEO and Rank Math both generate /llms.txt from your content. You can also upload a hand-written llms.txt to the web root. llms.txt is a proposal, and both plugin vendors say adoption by AI platforms is limited.
Other website builders and cmss
Related
Sources
Checked against these pages on 2026-10-19. Operators change their crawlers; check the source before relying on a detail.
- WordPress Developer Reference: do_robots()
- WordPress Developer Reference: robots_txt filter
- Make WordPress Core: New XML Sitemaps Functionality in WordPress 5.5
- WordPress Codex: Settings Reading Screen
- Yoast: How to edit robots.txt through Yoast SEO
- Yoast: XML sitemaps in the Yoast SEO plugin
- Yoast: Submit your sitemap to search engines
- Yoast developer docs: XML sitemaps functional specification
- Yoast: How to enable llms.txt with Yoast SEO
- Yoast developer docs: Schema functional specification
- Rank Math: Using Rank Math's robots.txt generator
- Rank Math: How to use llms.txt in Rank Math SEO