To add llms.txt to WordPress, use one of three methods: a plugin that generates the file for you, a static file uploaded to your site root by hand, or a small code snippet that serves the file dynamically. All three put the file at yourdomain.com/llms.txt, which is the only location that matters. If you want the fastest setup with the least maintenance, use a plugin. If you want full control over every line, upload a static file. If you want control plus automatic updates, use the code snippet. This guide walks through all three, with the exact steps for each.
llms.txt is a plain-text Markdown file that gives AI systems a short, curated map of your site: what it is about, and which pages matter most. It was proposed by Jeremy Howard in September 2024 as a way to help language models use websites efficiently, and the format is documented at llmstxt.org, without chewing through navigation menus, cookie banners, and heavy JavaScript. It is not an official web standard, and no major AI provider is required to read it. But it costs almost nothing to add, and several AI crawlers do fetch it when it is present. For a WordPress site, that makes it a cheap, low-risk addition to your AI-visibility work.
What llms.txt actually is (and what it is not)
Think of llms.txt as a welcome mat for AI systems. It does not control access to your site. That is robots.txt's job. It does not grant or deny permission to train on your content. It does not replace your sitemap, and it does not affect your Google rankings. Google has said its systems do not use llms.txt. What it does is point AI tools that already have access toward the pages you most want them to see, in a format that is cheap for them to read.
That distinction matters, because a lot of llms.txt advice online gets it wrong. You will see sample files with invented sections like "Training Allowed: No" or "Citation Required: Yes." Those are not part of the real format. The actual llms.txt format is simple: an H1 with your site name, a blockquote with a one-line summary, and H2 sections containing Markdown links with short descriptions. Anything else is decoration that AI tools are not obligated to honor. If you want to express training permissions, use robots.txt, a TDM reservation, or your terms of use — not a made-up section in llms.txt.
A good llms.txt file is short. Ten to thirty links beat two hundred. Every link should earn its place: your homepage, your most important service or category pages, your best guides, and your about and contact pages. A file that lists every post you have ever published is not a curated map. It is a second sitemap, and it defeats the purpose.
What belongs in a good llms.txt file
Before you pick a method, decide what the file will say. The structure is the same no matter how you publish it:
# Your Site Name
> One sentence describing what your site covers and who it is for.
## Key Guides
- [How to Block AI Crawlers With robots.txt](https://yoursite.com/block-ai-crawlers): Step-by-step guide with copy-paste rules.
- [What Is llms.txt?](https://yoursite.com/what-is-llms-txt): Plain-language explainer of the format.
## Services
- [Robots.txt Generator](https://yoursite.com/robots-generator): Free tool that builds a robots.txt file.
## About
- [About Us](https://yoursite.com/about): Who runs the site and why it exists.
- [Contact](https://yoursite.com/contact): How to reach us.
Three rules make a file like this work. First, every description is one factual sentence. No marketing copy, no superlatives, no keyword stuffing. Second, every link works and points to a real, public page. A dead link in a file meant to help AI systems navigate your site is worse than no file at all. Third, the file stays current. When you retire a page, remove its link. When you publish a major new guide, consider adding it. A stale llms.txt file quietly misleads every tool that reads it.
One more point on the optional llms-full.txt variant: it contains the full text of your pages, not just links. It is useful for documentation sites and for internal tools like coding agents. For a typical WordPress blog or business site, start with llms.txt only. Adding a full-text dump of your entire site is a bigger decision, and most sites do not need it.
Method 1: Use a plugin (easiest, best for most sites)
A plugin generates llms.txt for you and keeps it updated as your site changes. This is the method most WordPress site owners should choose. Your main SEO plugins now include llms.txt support, and dedicated llms.txt plugins exist in the WordPress plugin directory.
Step 1: Pick your plugin. If you already run Yoast SEO or Rank Math, check whether your version includes an llms.txt feature first — both have added llms.txt generation. In Yoast, look under Dashboard, then Settings, then Site Features. In Rank Math, check the module settings. If your SEO plugin does not offer it, install a dedicated plugin such as Website LLMs.txt from Plugins, then Add New, or browse the WordPress plugin directory. Search for "llms.txt," check that the plugin is actively maintained and compatible with your WordPress version, then install and activate it.
Step 2: Turn the feature on. Open the plugin's settings page. Most plugins generate a default file the moment you activate them. Look for a toggle or checkbox labeled llms.txt and make sure it is enabled. Some plugins serve the file dynamically, which means there is no physical file to upload — the plugin builds it on every request or caches it.
Step 3: Curate what gets included. This is the step most people skip, and it is the one that matters most. The default file usually lists everything: all post types, all pages, all archives. Go through the settings and narrow it down. Include posts and pages. Exclude archives, tag pages, author pages, and anything thin or duplicative. If the plugin lets you write a custom introduction or pick featured links, use that to put your best pages first.
Step 4: Verify it loads. Open yoursite.com/llms.txt in a browser. You should see plain text, not a styled page and not a 404. Check that the links work and that the file reflects the curation you just did. If you see a 404, your caching plugin or server cache may be serving a stale response — clear the cache and try again.
Step 5: Set a maintenance habit. The advantage of a plugin is that it updates itself when you publish or delete content. Still, glance at the file once a month. Plugins can include new post types after an update, or pick up pages you would rather not advertise. A two-minute monthly check keeps the file honest.
The trade-off with plugins is control. You get whatever format and selection options the plugin offers. For most sites, that is a fair trade for automatic updates. If you need exact control over every line, use Method 2 or 3 instead.
Method 2: Upload a static file by hand (most control)
A static file is a plain-text file you write yourself and place in your WordPress root directory — the same folder that contains wp-config.php. This gives you total control over the content, and it works on any host, with any theme, and with no plugin at all.
Step 1: Write the file. Open any plain-text editor — Notepad on Windows, TextEdit in plain-text mode on Mac, or VS Code. Do not use Word or Google Docs; they add formatting that breaks the file. Name it exactly llms.txt, all lowercase. Write your H1, your blockquote summary, and your H2 sections with Markdown links, following the example above. Save it with UTF-8 encoding.
Step 2: Upload it to the site root. Connect to your host with SFTP (FileZilla is a free option) or open your host's File Manager in cPanel or its equivalent. Navigate to the WordPress root — the folder containing wp-config.php, wp-content, and wp-admin. Upload llms.txt there. Do not put it inside wp-content or any subfolder. The file must resolve at yoursite.com/llms.txt, with nothing between the domain and the filename.
Step 3: Verify it loads. Visit yoursite.com/llms.txt in a private browser window. You should see your exact file as plain text. If WordPress shows a 404 page instead, the file is in the wrong folder, or your server is configured to route all requests through WordPress. A file that physically exists in the web root normally takes priority over WordPress routing, so a 404 almost always means the upload landed in the wrong directory. Double-check the path.
Step 4: Plan for updates. This is the real cost of the static method. The file does not update itself. Every time you publish a major guide, retire a page, or restructure your site, you need to edit and re-upload it. Set a recurring reminder — monthly for an active blog, quarterly for a stable business site. A stale file that links to deleted pages is worse than no file, because it teaches AI tools to distrust your site's own guidance.
One common mistake: uploading llms.txt through the WordPress Media Library. Do not do this. The Media Library stores files under wp-content/uploads/ with date-based folders, so the file will never resolve at /llms.txt. The Media Library also restricts file types, and a .txt upload may be renamed or blocked. Always use SFTP or File Manager for root-level files.
Another mistake: naming the file LLMS.txt, llms.TXT, or llms-txt.txt. URLs are case-sensitive on most servers, and crawlers ask for exactly /llms.txt. One wrong character means a 404.
Method 3: Serve it dynamically with a small code snippet (control plus automation)
If you are comfortable adding a small PHP snippet, you can get the best of both worlds: full control over the content, plus automatic updates when your site changes. The trick is a must-use plugin, or "mu-plugin." WordPress loads mu-plugins automatically, and they cannot be accidentally deactivated from the admin dashboard.
Step 1: Create the mu-plugins folder. Connect via SFTP or File Manager and open wp-content. If there is no mu-plugins folder inside it, create one.
Step 2: Add the snippet. Create a file named llms-txt.php inside mu-plugins with code like this:
<?php
// Serve a dynamic llms.txt at /llms.txt
add_action('template_redirect', function () {
if (parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) !== '/llms.txt') {
return;
}
header('Content-Type: text/plain; charset=utf-8');
echo "# Your Site Name
";
echo "> One sentence describing what your site covers.
";
echo "## Key Guides
";
// Loop through your newest posts in a category:
$posts = get_posts(['numberposts' => 10, 'category_name' => 'guides']);
foreach ($posts as $post) {
echo '- [' . get_the_title($post) . '](' . get_permalink($post) . '): ' . get_the_excerpt($post) . "
";
}
exit;
});
Step 3: Customize it. The example above pulls your ten newest posts from one category. Adapt it to your site: add fixed sections for your cornerstone pages, pull specific categories, or hard-code the whole file if you prefer. The point is that the file is generated from your live content, so it can never go stale the way a static file does.
Step 4: Verify and maintain. Visit yoursite.com/llms.txt and confirm it renders as plain text. Test it after theme or plugin updates, since anything that changes how WordPress handles requests can interfere. Keep a backup of the snippet — mu-plugins are not covered by WordPress's normal plugin update system, so if you lose the file, the llms.txt file disappears with it.
This method is the most flexible, but it requires someone on the team who can read PHP and fix the snippet if WordPress changes something. If that person is not you, Method 1 is the safer choice. A broken snippet can white-screen your site if it contains a syntax error, so test on a staging site first if you have one, and check the file with php -l before uploading.
Which method should you pick?
The right choice depends on how often your site changes and how much control you need:
- Plugin (Method 1): Best for most sites. Fastest setup, automatic updates, good enough curation. Choose this if you publish regularly and do not want another file to maintain by hand.
- Static file (Method 2): Best for stable sites and perfectionists. Total control, zero plugin overhead, but you own every update. Choose this if your site rarely changes and you want every line exactly as written.
- Code snippet (Method 3): Best for developers and larger sites. Full control plus automatic updates, but you own the code. Choose this if you have technical help and want the file to track your content automatically.
Whichever method you pick, the result should be identical from a crawler's point of view: a plain-text file at /llms.txt with a curated list of your best pages. Crawlers do not care how the file got there.
Common mistakes that make llms.txt useless
Dumping every URL. A 500-link file is not a map, it is a sitemap in Markdown. AI tools have limited context, and a bloated file wastes it on your weakest pages. Curate ruthlessly.
Inventing permission sections. As noted above, sections like "Training Allowed: No" are not part of the llms.txt format. They may look official, but no AI system is obligated to read them, and they can give you a false sense of protection. Put permissions in robots.txt, a TDM reservation, or your terms.
Linking to blocked pages. If a page is disallowed in robots.txt, do not feature it in llms.txt. A bot that respects robots.txt will not fetch it anyway, and the contradiction makes your site look sloppy.
Forgetting the file exists. Every method except a well-built dynamic one goes stale. Put a recurring task on your calendar. When you audit your sitemap, audit your llms.txt file too.
Expecting ranking magic. llms.txt will not improve your Google rankings, and Google has said it does not use the file. Its value is in the non-Google AI ecosystem: tools and agents that do read it, and that will represent your site more accurately because of it. Treat it as infrastructure, not a ranking trick.
How to check that it worked
Verification takes two minutes. First, open yoursite.com/llms.txt in a private window and confirm you see plain text, not a WordPress page. Second, check your server logs or your host's analytics for requests to /llms.txt over the next few weeks. You will likely see AI crawlers such as GPTBot and ClaudeBot fetching it. A fetch is not a guarantee that the crawler used the file, but it confirms the file is discoverable. Third, re-check after every major site change. A redirect, a host migration, or a caching-plugin update can all break a file that worked yesterday.
If you want a head start on the content itself, generate a draft with our free llms.txt generator, then paste the result into whichever method you chose and curate it. Pair it with a clean robots.txt file so the same AI crawlers you are guiding can actually reach the pages you are pointing them to, and keep your sitemap accurate so search engines find those pages too.
FAQ
Does WordPress have a built-in llms.txt feature?
WordPress core does not generate llms.txt. You need a plugin, a manual upload, or a code snippet. Major SEO plugins such as Yoast and Rank Math have added llms.txt features, so check your existing SEO plugin before installing anything new.
Will llms.txt improve my Google rankings?
No. Google has said its systems, including AI Overviews and AI Mode, do not use llms.txt. The file is for the non-Google AI ecosystem — other AI crawlers, agents, and tools that do fetch it. Add it for accurate AI representation, not for rankings.
Can I upload llms.txt through the WordPress Media Library?
No. The Media Library stores files under wp-content/uploads/ with date folders, so the file will never resolve at /llms.txt. Use SFTP or your host's File Manager to place it in the WordPress root directory.
Do I still need robots.txt if I have llms.txt?
Yes. They do different jobs. Robots.txt controls which bots may crawl your site. llms.txt guides bots that already have access toward your most important pages. Every site should have both, and they should agree with each other.
How often should I update my llms.txt file?
Review it monthly if you publish regularly, and quarterly if your site is stable. Update it whenever you publish a major guide, retire a page, or restructure your site. Plugin and dynamic methods handle most updates automatically, but a quick monthly glance still pays off.
What if my llms.txt URL shows a 404?
Check that the file is in the WordPress root (the folder with wp-config.php), that the filename is exactly llms.txt in lowercase, and that no caching layer is serving a stale response. Clear your site and server caches, then retry in a private browser window.