GeoPromptTracker

How to add llms.txt to WordPress (3 methods, no plugin required)

Published July 15, 2026

The fastest way to add llms.txt to WordPress: generate the file, then upload it to your site's root directory (the folder containing wp-config.php) using your host's file manager. It's live immediately at yoursite.com/llms.txt — no plugin, no code. Two other methods below cover managed hosts without file access and sites that want the file generated dynamically.

Before you start: create the file itself

Whichever method you use, you need the file's content first. llms.txt is plain Markdown: an H1 with your site name, a one-line summary in a blockquote, and sections of links to your key pages. Build it in two minutes with the free llms.txt Generator — paste your sitemap URL and it can prefill your pages — or start from one of our annotated examples. Save the result as a file named exactly llms.txt.

Method 1: Upload via file manager (recommended)

Works on any host that gives you file access — cPanel, Plesk, SiteGround Site Tools, Hostinger hPanel, or plain SFTP.

  1. Log in to your hosting control panel and open File Manager (or connect with an SFTP client like FileZilla).
  2. Navigate to your WordPress root — the folder containing wp-config.php, wp-content, and wp-admin. On most hosts it's called public_html, www, or your domain name.
  3. Click Upload and select your llms.txt file.
  4. Visit https://yoursite.com/llms.txt. You should see your Markdown as plain text.

That's it. WordPress serves files that physically exist before it routes anything through PHP, so the file just works — the same mechanism that serves your robots.txt if you have a physical one.

If you see your theme's 404 page instead: the file landed in the wrong folder (a common miss is uploading into wp-content). Move it up to the root.

Method 2: functions.php snippet (no file access needed)

On managed hosts that hide the filesystem (some WordPress.com plans, restrictive managed WP hosts), you can serve llms.txt from code. Add this to your child theme's functions.php or a code-snippets plugin:

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' ) ) {
        header( 'Content-Type: text/plain; charset=utf-8' );
        echo "# Your Site Name\n\n";
        echo "> One line describing what your site is about.\n\n";
        echo "## Key pages\n\n";
        echo "- [About](" . esc_url( home_url( '/about/' ) ) . "): Who we are\n";
        echo "- [Blog](" . esc_url( home_url( '/blog/' ) ) . "): Latest articles\n";
        exit;
    }
} );

Replace the echoed content with your own file (from the generator). After adding the code, go to Settings → Permalinks and click Save Changes once — this flushes WordPress's rewrite rules so /llms.txt starts resolving.

Why this method is second choice: the content lives in code, so updating it means editing PHP. Fine for a file you rarely touch; annoying if you iterate.

Method 3: Use a plugin

Search the plugin directory for "llms.txt" and you'll find several options, and major SEO plugins have been adding llms.txt generation as a feature. A plugin makes sense if you want the file auto-generated from your published content — for example, always listing your latest posts without manual edits.

The trade-offs are the usual WordPress ones: another plugin to keep updated, and auto-generated files are usually less curated than hand-picked ones. Since curation is the whole point of llms.txt, we'd still take a hand-written file uploaded once over an automatic dump of recent posts. If you do use a plugin, check its output against the spec with the validator — several early plugins produce HTML-wrapped or malformed files.

Verify it works

Whichever method you chose, run these three checks:

  1. Direct visit: yoursite.com/llms.txt shows raw Markdown text — no theme styling, no 404, no redirect to the homepage.
  2. Content-Type: it should be served as text/plain (Method 1 does this automatically; some CDN/caching layers occasionally mislabel it).
  3. Spec check: paste your URL into the llms.txt Validator — it verifies the H1, blockquote, section structure, and link format, and flags anything a parser would choke on.

If you use a caching plugin (WP Rocket, W3 Total Cache, LiteSpeed), purge the cache after uploading — some configurations cache 404 responses, which can keep serving "not found" for a path that now exists.

Keep it current

An llms.txt that points at deleted pages actively hurts: it teaches AI systems your file can't be trusted. Set a reminder to regenerate it when you restructure your site, rename key pages, or launch something worth listing. For most WordPress sites that's a five-minute task twice a year — the best effort-to-impact ratio in AI visibility.

Frequently asked questions

Where does llms.txt go in WordPress?

At your site root, so it's reachable at yoursite.com/llms.txt. Physically that means the same directory as wp-config.php — usually public_html or www on your host's file manager.

Do I need a plugin to add llms.txt to WordPress?

No. Uploading a plain text file to your site root via your host's file manager takes two minutes and adds zero plugin overhead. Plugins only make sense if you want the file auto-updated as you publish.

Will llms.txt conflict with my SEO plugin?

No. Yoast, Rank Math, and AIOSEO manage robots.txt and sitemaps, not llms.txt. Some have begun adding llms.txt features — if yours generates one, don't also upload a manual file, or the physical file will take precedence.

How do I check my WordPress llms.txt works?

Visit yoursite.com/llms.txt in a browser — you should see plain Markdown text, not a styled page or a 404. Then run it through our free llms.txt Validator to confirm it follows the spec.

Related