🚀 Launch Offer: 20% off your first year for new customers with code WPCWP20 — until 31 October 2026
WPCWP

How to Add llms.txt to WordPress

Technical

Last updated September 17, 2026

llms.txt is a proposed convention: a plain-text file at your site root that gives a language model a curated map of your content, in Markdown, without the navigation and boilerplate that surround it in HTML.

It takes about twenty minutes to add. Before you do, here is the honest assessment.

Manage your expectations

No major AI vendor has committed to reading llms.txt, and there is no public evidence that any of them currently weights it. It is a convention someone proposed and a community adopted, not a standard anyone is obliged to honour. It is cheap, it is harmless, and it is not a ranking lever. Do the items in the visibility checklist first.

What the file looks like

An H1 with your site name, a blockquote summarising it, then H2 sections listing links with one-line descriptions. That is the whole format.

# WP Content Writer Pro

> AI post writing inside the WordPress editor, priced per site rather than
> per word. Bring your own key for Anthropic, OpenAI, Gemini, NVIDIA NIM or
> OpenRouter.

## Product

- [Features](https://wpcontentwriter.com/features): What the plugin does the day you install it.
- [Pricing](https://wpcontentwriter.com/pricing): Per-site licensing, one to fifteen domains.

## Documentation

- [Getting started](https://wpcontentwriter.com/kb/getting-started/): Install, licence, first draft.
- [AI providers](https://wpcontentwriter.com/kb/ai-providers-and-failover/): Keys, models and failover.

There is also a convention of publishing llms-full.txt containing the full text of your key pages rather than links to them. Useful for a small documentation site, unwieldy past a few dozen pages.

Adding it to WordPress

The obvious approach — drop a file in the web root — works until a WordPress update, a migration or a deployment replaces that directory. Three options, worst to best.

Option 1: a static file in the root

Upload llms.txt next to wp-config.php. It works immediately. It is also outside WordPress, so nothing regenerates it when your content changes, and it will quietly go stale. If you take this route, put a reminder in whatever process you use for releases.

Option 2: a rewrite rule and a template

Register a rewrite so WordPress itself answers the URL. This survives file-level changes and can be generated from your actual content.

add_action('init', function () {
    add_rewrite_rule('^llms\.txt$', 'index.php?llms_txt=1', 'top');
});

add_filter('query_vars', function ($vars) {
    $vars[] = 'llms_txt';
    return $vars;
});

add_action('template_redirect', function () {
    if (! get_query_var('llms_txt')) {
        return;
    }

    header('Content-Type: text/plain; charset=utf-8');

    echo '# ' . get_bloginfo('name') . "\n\n";
    echo '> ' . get_bloginfo('description') . "\n\n";
    echo "## Documentation\n\n";

    foreach (get_pages(['sort_column' => 'menu_order']) as $page) {
        printf("- [%s](%s)\n", get_the_title($page), get_permalink($page));
    }

    exit;
});

Flush permalinks once after adding it, or the rule will not be live. Settings, then Permalinks, then Save.

Option 3: generate it at build or deploy time

If your site is built or deployed by a script, generate the file from the pages that actually shipped. This is what we do for the marketing site: the deploy walks the pages it just built and writes both llms.txt and llms-full.txt from them. A page cannot be listed unless it shipped, and cannot ship without being listed.

That property is the real argument for this option. Every hand-maintained index of a website eventually lies.

How quickly each one goes stale

Static file Stale the first time you publish a page

Rewrite rule Reads live content, so it cannot drift

Built at deploy Generated from what actually shipped

All three publish the same file. They differ only in whether anyone has to remember to update it, which is the part that fails.

Pick by how the file gets maintained, not by how quickly you can publish it once.

Checking it works

curl -sI https://example.com/llms.txt | head -3

You want 200 and Content-Type: text/plain. A 404 after using the rewrite approach almost always means permalinks were not flushed. HTML instead of plain text means your theme caught the request before your handler did.

Common questions

Do AI engines actually read llms.txt?

No vendor has committed to it, and there is no public evidence of it being weighted today. Some crawlers fetch it, which proves curiosity rather than use. Publish it because it is cheap, not because you expect a result.

Is it a replacement for a sitemap or robots.txt?

No. robots.txt controls access and is honoured. sitemap.xml is a machine-readable index that search engines definitely use. llms.txt is a curated summary for models, and it replaces neither.

Should I list every page?

No, and that is the point of it. It is a curated map: the pages you would show someone who asked what you do. A dump of every URL is a sitemap, and you already have one.

What about llms-full.txt?

Full text rather than links. Sensible for a compact documentation set, unwieldy beyond a few dozen pages, and it duplicates content you already publish as HTML. We generate one because our page count is small.

Will this hurt my SEO?

No. It is a text file nobody’s ranking algorithm consumes. The only real risk is the one every stale file carries: if it contradicts your live pages, you have given a model another reason to distrust you.

Where to go next

GPTBot vs ClaudeBot vs PerplexityBot is the file that actually changes behaviour. Schema markup for AI search is the one search engines definitely read.

Did this answer it? Tell us if not and we will fix the article.