PSD to HTML vs. modern WordPress development: what actually changed
Published in Trends and Innovations
on September 15, 2026

How I Added an llms.txt File to a WordPress Site (and Why)

AI assistants like ChatGPT, Claude, and Perplexity are answering more of the questions that used to go to Google – and most of them can’t read a WordPress site the way a search engine crawler does. llms.txt is a young, informal standard meant to fix that: a plain-text file at your site’s root that gives AI tools a clean, structured summary of what your site is and where to find things. I added one to this site earlier this year. Here is how, and what I ran into.

What llms.txt actually is

It is a Markdown file served at /llms.txt – a short overview of the site followed by categorized links, similar in spirit to a sitemap but written for an AI model to read, not a crawler to parse. There is no official governing body yet and no guarantee every AI product respects it, but adoption is growing, and it costs almost nothing to add. You can see this site’s version at thechoppr.com/llms.txt.

Why a static file did not work here

The obvious approach is to drop a static llms.txt file at your server’s document root. On a normal single-site WordPress install, that is exactly right. It did not work for this site, because thechoppr.com runs on a WordPress Multisite network that shares one filesystem with three other domains. A static file at the document root gets served identically for every site on the network – not just the one you meant it for. I confirmed this the same way I’d confirm it for you: comparing how Yoast SEO generates robots.txt per-site dynamically, rather than serving one static file network-wide, and following the same pattern.

Building it as a dynamic route instead

The fix was to make /llms.txt a real WordPress route, generated by the theme, so it is scoped to this site’s theme code and can never bleed into the other sites on the network. Four pieces, in functions.php:

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

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

add_action( 'template_redirect', function () {
    if ( ! get_query_var( 'choppr_llms_txt' ) ) {
        return;
    }
    header( 'Content-Type: text/plain; charset=UTF-8' );
    echo "# Your Site

> A short description...";
    exit;
} );

That alone almost worked – except every request to /llms.txt was 301-redirecting to /llms.txt/ before it ever reached the handler. WordPress’s own redirect_canonical() special-cases robots.txt as a “file-like” URL that should not get a trailing slash, but it does not know to do the same for a custom endpoint like this one. The fix is one more filter:

add_filter( 'redirect_canonical', function ( $redirect_url ) {
    if ( get_query_var( 'choppr_llms_txt' ) ) {
        return false;
    }
    return $redirect_url;
}, 5, 2 );

With that in place, /llms.txt resolves directly, the same way /robots.txt does.

What actually goes in the file

Keep it honest and specific: a one-paragraph summary of who you are, then grouped links to your real, current pages – services, portfolio, contact, legal. Do not pad it with keyword-stuffed descriptions; the whole point is giving an AI model something accurate to cite. I keep this site’s version in sync with the actual page structure by hand, since it is short enough that automating it would be more work than it saves.

If you want this on your site

This took about an hour end to end, most of it spent finding the redirect_canonical issue. If you are on a normal single-site WordPress install, it is even simpler – a static file at the document root works fine. If you are on Multisite, or just want it done properly rather than guessed at, get in touch.