How to Implement llms.txt on WordPress
The llms.txt file is a plain-text Markdown file placed at the root of your domain (https://yoursite.com/llms.txt) that tells AI systems which content matters most on your site. Think of it as a sitemap designed specifically for language models.
What Is llms.txt?
While robots.txt tells crawlers what not to index and sitemap.xml lists all URLs, llms.txt does something different: it provides a prioritized, human-readable index of your most important content with one-line descriptions.
AI systems have limited context windows. When an LLM encounters your site, it can't read everything. The llms.txt file tells it: "Start here. These are the pages worth understanding."
The format is simple Markdown:
# Your Site Name
> One-line description of what this site is about.
## Main Content
- /pricing: Plans and pricing for all tiers
- /docs/getting-started: Quick start guide for new users
- /blog/geo-guide: Complete guide to Generative Engine Optimization
## API Reference
- /docs/api/analyze: GEO scoring endpoint documentation
- /docs/api/transform: HTML-to-Markdown conversion endpoint
Why llms.txt Matters
Sites with a valid llms.txt file show measurably higher inclusion rates in AI-generated answers. The file serves three purposes:
- Discovery — AI systems know where to find your best content without crawling your entire sitemap.
- Prioritization — You control which pages get attention when context window space is limited.
- Efficiency — Descriptions let the AI pre-filter relevant pages before fetching full content.
Major platforms including Stripe, Anthropic, Cloudflare, and Vercel already serve llms.txt files. The standard has been adopted by over 18,500 enterprise domains as of early 2026.
WordPress Implementation: Three Options
Option 1: Static File (Simplest)
Create a file named llms.txt in your WordPress root directory (the same folder as wp-config.php):
# SSH into your server
cd /var/www/html # or your WordPress root
nano llms.txt
Add your content following the Markdown format above. Apache/Nginx will serve it as a static file at /llms.txt.
Pros: Zero overhead, instant, no plugins needed.
Cons: Manual updates required when you add/remove pages.
Option 2: Zitably Plugin (Automated)
The Zitably plugin includes a built-in llms.txt editor with two modes:
- Manual editor — Write your own llms.txt content from within WordPress admin (free tier)
- AI-generated — Let the AI analyze your site structure and generate an optimized llms.txt automatically (Pro tier)
The plugin writes the file to your WordPress root and keeps it updated as you publish or unpublish content.
Option 3: Dynamic via Rewrite Rule
For sites with frequently changing content, you can generate llms.txt dynamically:
// In your theme's functions.php or a custom plugin
add_action('init', function() {
if ($_SERVER['REQUEST_URI'] === '/llms.txt') {
header('Content-Type: text/plain; charset=utf-8');
header('Cache-Control: public, max-age=3600');
$site_name = get_bloginfo('name');
$description = get_bloginfo('description');
echo "# {$site_name}\n";
echo "> {$description}\n\n";
echo "## Pages\n\n";
$posts = get_posts([
'post_type' => 'page',
'numberposts' => 20,
'orderby' => 'menu_order',
]);
foreach ($posts as $post) {
$url = wp_make_link_relative(get_permalink($post));
$excerpt = wp_trim_words($post->post_excerpt ?: $post->post_content, 15, '');
echo "- {$url}: {$excerpt}\n";
}
exit;
}
});
Pros: Always up to date, no manual maintenance.
Cons: Slight performance overhead (cacheable), requires code.
Best Practices
- Keep it concise — 20–50 entries maximum. This isn't a sitemap; it's a curated index.
- Lead with your best content — Put your most authoritative pages first. Order signals priority.
- Write clear descriptions — Each line should tell the AI what it'll find at that URL.
- Update regularly — Stale
llms.txtfiles with dead links damage trust signals. - Include content types — Group by section (Blog, Docs, Products) so AI can navigate by intent.
- Test it — Visit
https://yoursite.com/llms.txtin a browser. If it renders as plain text, you're good.
Validation
You can verify your llms.txt is being consumed by checking AI bot traffic logs. Common AI crawlers that read llms.txt:
- GPTBot (OpenAI)
- ClaudeBot (Anthropic)
- PerplexityBot
- Google-Extended
The Zitably plugin tracks these requests in your WordPress dashboard, showing which bots accessed your llms.txt and when.
Common Mistakes
- Putting it in a subdirectory — It must be at the domain root:
example.com/llms.txt, notexample.com/wp-content/llms.txt. - Using HTML instead of Markdown — The file should be plain Markdown, not HTML.
- Listing every URL — This defeats the purpose. Curate, don't dump.
- Forgetting to update — A stale index is worse than no index.
Already using Zitably? The plugin handles all of this automatically. See how the llms.txt editor works →