What is llms.txt?
llms.txt is a Markdown file served at /llms.txt that gives AI systems a curated, plain-text map of a website’s most important content. The format was proposed in late 2024 by Jeremy Howard at Answer.AI. For a plain-English overview, see what is llms.txt; this guide is about shipping one on WordPress specifically.
Where does llms.txt live on a WordPress site?
At the web root, served at /llms.txt — the same path rule as every other site. The wrinkle is that WordPress is a front controller: it rewrites unknown URLs through index.php so they can be resolved as posts and pages. A real file sitting in the root sidesteps that rewrite, because both the default Apache .htaccess rules and a standard Nginx try_files block serve existing files before falling back to WordPress. The five steps below cover the manual file path; the plugin (auto-generated) path is described after.
Step 1 — Write your llms.txt content
In any plain-text editor, build the file. The llmstxt.org spec mandates two elements: an # H1 with your site name and a blockquote summary one or two sentences long. After that, add ##section headings with bullet-point links to your most authoritative pages — documentation, key products, policies. Quality over quantity: AI systems prefer a short, high-signal index.
# Acme Cloud Widgets
> Widgets-as-a-service for serverless apps. Deploy in one command.
## Documentation
- [Getting started](https://acme.dev/docs/start): Zero to deployed in 60 seconds
- [API reference](https://acme.dev/docs/api): REST endpoints and authentication
- [SDKs](https://acme.dev/docs/sdks): Official client libraries
## Policies
- [Privacy policy](https://acme.dev/privacy): Data handling and retention
- [Terms of service](https://acme.dev/terms): Usage terms
## Optional
- [Sitemap](https://acme.dev/sitemap.xml)
- [llms-full.txt](https://acme.dev/llms-full.txt): Full content bundle
An optional llms-full.txt companion concatenates the full content of those URLs into one Markdown bundle — useful for docs-heavy sites. See what is llms-full.txt.
Step 2 — Upload the file to your WordPress root directory
Connect over SFTP or open your host’s file manager (cPanel, Plesk, or the dashboard your host provides) and drop llms.txt in the web root— the folder that contains wp-config.php, wp-admin, and wp-content. The file then resolves at https://yoursite.com/llms.txt. Don’t put it inside wp-content, a theme folder, or a subdirectory.
Step 3 — Confirm WordPress serves the file directly
Because WordPress routes unknown URLs through index.php, you want the server to hand back the real file first. On Apache the default WordPress .htaccess already does this — the !-f condition excludes existing files from the rewrite. On Nginx the standard try_files line serves the file before falling back to WordPress; a misconfigured block that jumps straight to index.php will 404 the request inside WordPress instead.
# Apache — the default WordPress .htaccess already does this:
# requests for files that exist (!-f) and dirs that exist (!-d)
# are served directly, so a real /llms.txt is returned as-is.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# Nginx — try_files serves the real file first, then falls back to WP:
location / {
try_files $uri $uri/ /index.php?$args;
}
Step 4 — Verify it returns text/plain
Send a HEAD request to confirm the file returns HTTP 200 with a text/plain Content-Type. If a caching plugin or CDN returns text/html or a stale body, purge the cache and confirm the CDN passes .txt through untouched.
curl -I https://yoursite.com/llms.txt
# Expected response:
# HTTP/2 200
# content-type: text/plain; charset=utf-8
Step 5 — Validate against the llmstxt.org spec
Run your URL through the llms.txt checker to confirm the file passes the 10-check compliance suite — H1 present, blockquote summary, valid Markdown, correct link format, accessible URLs, proper Content-Type, and the optional llms-full.txt companion. Failed checks come with a one-line fix each.
How do I generate llms.txt with a plugin?
If you’d rather not maintain the file by hand, a dedicated llms.txt plugin can build it from your published posts and pages and regenerate it as content changes — the WordPress equivalent of generating the file dynamically. Browse the llms.txt plugins in the WordPress directory, install one from Plugins → Add New, and configure which post types and pages it includes. The trade-off mirrors the static-vs-dynamic choice on any stack: a plugin stays in sync automatically but exposes whatever it’s configured to, so review its output before trusting it.
Whichever route you pick, the file still has to serve as text/plain at /llms.txt and pass the spec — verify the plugin’s output the same way you’d verify a hand-written file.
Common pitfalls when adding llms.txt to WordPress
- Creating it as a Page or Post. A Page titled “llms.txt” renders HTML at
/llms-txt/with atext/htmlContent-Type — wrong path, wrong type. Use a real file. - Wrong directory. The file must sit in the web root next to
wp-config.php, not inwp-contentor a theme folder. - Caching plugin or CDN interference. Page caches and CDNs can serve a stale body or rewrite the Content-Type. Purge after every change and let
.txtpass through as a static asset. - Nginx routing to index.php. A
try_filesrule that skips$urisends the request into WordPress and 404s it. Make sure the real file is matched first. - Expecting an SEO plugin to do it. Yoast and Rank Math handle sitemaps and robots.txt, not llms.txt. Upload manually or use a dedicated plugin.
Frequently asked questions
- Do I need a plugin to add llms.txt to WordPress?
- No. The simplest approach is to upload a static llms.txt file to your site's root directory over SFTP or the host file manager — no plugin required. Reach for a plugin only if you want the file generated automatically from your published posts and pages and kept in sync as content changes.
- Where exactly do I put the llms.txt file in WordPress?
- In the web root — the same folder that contains wp-config.php, wp-admin, and wp-content. That makes it resolve at https://yoursite.com/llms.txt, which is the canonical path AI clients try first. Don't place it inside wp-content, a theme directory, or a subfolder; for a WordPress install in a subdirectory, use that subdirectory's root.
- Can I create an llms.txt as a WordPress Page or Post?
- No. A Page or Post titled 'llms.txt' renders as HTML at a slug like /llms-txt/, with a text/html Content-Type and the wrong path — three things that fail the spec at once. llms.txt must be a real plain-text file served at /llms.txt with a text/plain Content-Type, which a Page cannot produce.
- Will my caching or CDN plugin break llms.txt?
- It can. Aggressive page caches and CDNs sometimes serve a stale body or rewrite the response to text/html. After you add or edit the file, purge the cache, and check that your CDN treats /llms.txt as a static text asset that passes through with a text/plain Content-Type rather than routing it through WordPress.
- Does Yoast or Rank Math generate llms.txt automatically?
- No. SEO plugins like Yoast and Rank Math generate XML sitemaps and manage robots.txt, but they do not produce llms.txt — it's a different, newer convention. Either upload the file manually or install a dedicated llms.txt plugin that builds it from your content.