The most reliable way is to create a plain text file named llms.txt and upload it to the folder that holds wp-config.php. If you prefer a plugin, Yoast SEO and Rank Math both have a toggle that generates one. Either way, confirm that /llms.txt returns HTTP 200 as plain text and that your cache is not serving an old 404.
Pick a method
| Method | Where the content lives | Good for | Watch out for |
|---|---|---|---|
| Upload a file | A text file you write and keep in the web root | Full control, no plugin | You must update it by hand when pages move |
| Yoast SEO | Generated from your content. Yoast SEO, Settings, Site features, AI tools, LLMS.txt. Free; not available on multisite | Sites already on Yoast | Yoast says a failed generation points to web server file permissions |
| Rank Math | LLMS Txt module on the Dashboard; edit under General Settings | Sites already on Rank Math | The file is empty until you configure it. The default limit is 100 entries per type. noindex posts are left out |
| Code snippet | A file in wp-content, served by a small hook | Sites where the root is not writable | You maintain the code |
Pick one. Running a plugin and a hand-uploaded file at once leaves you unsure which one visitors get. Neither Yoast nor Rank Math documents what happens when a physical file already exists, so remove the old file before you turn a plugin on.
Method 1: upload the file
- Write the file in a plain text editor and save it as
llms.txtwith UTF-8 encoding. The format is described on the llms.txt checker page. - Connect with SFTP or open your host's file manager.
- Open the folder that contains
wp-config.php,wp-adminandwp-content. That is the web root for most installs. - Upload the file there.
- Open
https://yoursite.com/llms.txtin a private window and check that you see raw text.
With most server setups a real file in the web root is served by the web server itself, before WordPress runs, so no plugin is involved.
Method 2: let Yoast or Rank Math generate it
In Yoast SEO, go to Yoast SEO, Settings, Site features, then AI tools, open LLMS.txt, turn the toggle on and save. Yoast describes the output as a markdown file that says what the site is about, shows where important content is and links to plain-text versions of it. You can let it choose content automatically or switch to manual selection and preview the result.
In Rank Math, turn on the LLMS Txt module from the Dashboard, then open Rank Math SEO, General Settings, Edit llms.txt. You choose post types and taxonomies, a limit, and extra links or text. Rank Math says the file is empty until you set it up.
Generated files list what the plugin selects, not what you would pick. Open the result and remove thin pages, tag archives and anything you would not send a new visitor to first.
Method 3: serve a file with a small snippet
Use this when you cannot write to the web root, for example on a locked-down managed host. Save your content as wp-content/llms.txt, then add the snippet below to a small must-use plugin or your child theme's functions.php. It hooks template_redirect, which WordPress runs before it chooses a template, and answers only for the exact path /llms.txt. It reads a file you control and does not use any visitor input.
<?php
add_action( 'template_redirect', function () {
$path = wp_parse_url( $_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH );
if ( '/llms.txt' !== $path ) {
return;
}
$file = WP_CONTENT_DIR . '/llms.txt';
if ( ! is_readable( $file ) ) {
return;
}
status_header( 200 );
header( 'Content-Type: text/plain; charset=utf-8' );
readfile( $file );
exit;
}, 1 );
Priority 1 runs the hook ahead of WordPress's own redirect logic. If your site sits in a subfolder, such as /blog/, the request path starts with that folder and the comparison needs to match it. A page cache that stores full responses may answer first; see the caching section below.
An example file for a WooCommerce store
This is an example for a made-up shop, not a template to copy line by line. Use your own pages and keep it short enough to read in one pass.
# North Ridge Outfitters
> Family-run store selling hiking boots, packs and repair kits. Ships from Oregon to the US and Canada.
We write our own gear guides and test every boot we sell. Returns are free for 60 days.
## Shop
- [Hiking boots](https://northridge.example/shop/boots/): men's and women's, sizes 5 to 15
- [Packs](https://northridge.example/shop/packs/): day packs and 40 to 70 litre packs
- [Repair kits](https://northridge.example/shop/repair/): patches, laces and resole kits
## Help
- [Shipping and returns](https://northridge.example/shipping-returns/): costs, delivery times, return window
- [Size guide](https://northridge.example/size-guide/): how to measure your foot
## Guides
- [How to break in hiking boots](https://northridge.example/guides/break-in-boots/)
- [Choosing a pack size](https://northridge.example/guides/pack-size/)
## Optional
- [About us](https://northridge.example/about/)
- [Blog archive](https://northridge.example/blog/)
For a SaaS product on WordPress, swap the Shop section for Docs and Pricing. Leave out cart, checkout and account pages. Nobody needs those summarized.
Verify it works
A browser tab can hide problems, so check the raw response:
curl -I https://yoursite.com/llms.txt
- The status line should be
200. A404means the file or hook is not reached; a301or302means something redirects it. content-typeshould betext/plain(ortext/markdown), nottext/html.- The first line of the body should start with
#.
Then run the address through the llms.txt checker, which validates the format and tests the links in the file. Our AI crawler checker shows whether robots.txt lets the AI bots reach those pages at all. For who reads the file and what Google says about it, see the checker page; we do not repeat it here.
Caching and CDN pitfalls
- A cached 404. If someone, or a monitoring tool, requested
/llms.txtbefore the file existed, a page cache or CDN may keep serving that 404 until it expires. Purge the single URL after you add the file. - Stale content. Edits do not show up because the old text is cached. Purge again after every change.
- Bot or firewall rules. A CDN or security plugin can block or challenge requests that look automated, so a tool gets a 403 while you see the file. See how Cloudflare settings block AI crawlers.
- HTML instead of text. A catch-all rule or a theme that answers every unknown path with a normal page returns 200 with HTML. The content-type check above catches it.
- Staging copies. A file that lists staging or development addresses sends readers to pages you do not want them to see. Search the file for the domain before you publish.
Questions people ask
Where does llms.txt go in WordPress?
At the web root, so it loads at https://yoursite.com/llms.txt. That is usually the folder that holds wp-config.php and wp-content. If WordPress lives in a subfolder, the web root may be one level up.
Can I use a plugin instead of uploading the file?
Yes. Yoast SEO has an LLMS.txt toggle under Site features, and Rank Math has an LLMS Txt module. Both generate the file from your content. Check the output, because a generated file lists whatever your plugin settings select.
I created the file but /llms.txt still shows a 404. Why?
Most often the file is in the wrong folder, a page cache or CDN is still serving the old 404, or a security rule blocks .txt files. Test with curl to see the status code and content type, then purge the cache.
Will this help my rankings in Google?
Google says its Search ignores llms.txt. The file is a convenience for tools that choose to read it. Our checker page covers who reads it today.
Related
Sources
- llms.txt proposal and specification, accessed 2026-11-12.
- Yoast: Enable llms.txt in Yoast SEO, accessed 2026-11-12.
- Yoast: llms.txt feature, accessed 2026-11-12.
- Rank Math Knowledge Base: llms.txt module, accessed 2026-11-12.
- WordPress Developer Resources: template_redirect action, accessed 2026-11-12.