How to add llms.txt to WordPress
WordPress doesn't expose root-level files by default. The cleanest install uses a small mu-plugin or your theme's functions.php to serve /llms.txt dynamically, with SFTP as a fallback for static files.
Before you start
- ✓Admin or SFTP access to your WordPress install
- ✓An llms.txt body — generate one with the OptimAIze tool
- ✓Any caching plugin temporarily put in bypass mode while you verify
Install in 4 steps
- 1
Generate your llms.txt
Use the OptimAIze llms.txt generator to draft your file. Copy the Markdown body to your clipboard.
- 2
Drop the file in the WordPress root
SFTP into your site and place llms.txt next to wp-config.php. WordPress passes through root-level static files, so this works without code.
- 3
Or serve it dynamically
Add an init hook in a mu-plugin (wp-content/mu-plugins/llms-txt.php) that catches /llms.txt requests and outputs your content with the text/plain header. This survives WP updates and lets you template the file.
- 4
Verify
Open yoursite.com/llms.txt in a browser. Confirm UTF-8 encoding, text/plain content-type, and no caching plugin rewriting it to HTML.
Troubleshooting
Your security plugin (Wordfence, iThemes Security) is blocking unknown root files. Whitelist /llms.txt explicitly.
A caching plugin is rewriting the response. Add /llms.txt to the cache exclusion list and purge.
Cloudflare or WP Super Cache is serving a cached copy. Purge both layers.
Common gotchas
- • Some security plugins (Wordfence, iThemes) block unknown root files — whitelist /llms.txt
- • Caching plugins may serve a stale or HTML-wrapped version — exclude the path
- • If you use Cloudflare, purge the cached version after each update
Generate your llms.txt in 30 seconds
Use the free OptimAIze generator, then follow the steps above to deploy on WordPress.
Frequently asked questions
Does WordPress need both llms.txt and robots.txt?
Yes. robots.txt grants crawler permission; llms.txt curates which pages matter. Together they form the minimum AI-search setup on any WordPress site.
Will adding llms.txt slow down my site?
No. It's a tiny static text file fetched once and cached aggressively. Page-load impact is effectively zero.
How often should I update llms.txt?
Whenever your canonical content set changes — new docs section, new product line, new pricing page. A monthly review is a sensible cadence for most sites.
Can I see whether AI engines read my llms.txt?
Check your server logs for user agents like GPTBot, ClaudeBot, PerplexityBot, and Google-Extended hitting /llms.txt. Most sites see traffic within days of publishing.
Other platforms
The Crucial Role of llms.txt on WordPress
The `llms.txt` file acts as a vital directive for large language models (LLMs) and other AI agents accessing your WordPress site. Similar to `robots.txt` for search engine crawlers, `llms.txt` provides specific instructions on how your content should be consumed, cited, or even restricted by AI. For OptimAIze, properly implemented `llms.txt` can significantly enhance your AI visibility by signaling preferred content areas for knowledge ingestion while protecting sensitive or proprietary information. This proactive measure ensures your intellectual property is respected and that AI-driven responses accurately reflect your brand's authoritative voice, preventing misinterpretations or unauthorized usage across various AI platforms.
Implementing llms.txt on Your WordPress Site
Publishing `llms.txt` on WordPress involves creating a simple text file and placing it in your site's root directory. While WordPress doesn't have a native GUI for this, you can achieve it via SFTP/FTP, your hosting control panel's file manager, or using a specialized plugin that grants access to the root. The file should be named `llms.txt` (all lowercase) and be accessible at `yourdomain.com/llms.txt`. Ensure the file permissions allow reading by web servers. This direct placement is crucial for AI agents to discover and adhere to your directives immediately upon accessing your domain, making it a foundational step for effective AI visibility management.
Best Practices for Maintaining Your llms.txt File
Maintaining `llms.txt` is an ongoing process that requires periodic review and updates to remain effective. As your content strategy evolves, or as new AI models and directives emerge, your `llms.txt` file should reflect these changes. Regularly check for broken directives, ensure new sections of your site are properly addressed, and monitor the file's accessibility. Consider implementing version control if you make frequent changes. This proactive maintenance prevents outdated instructions from negatively impacting your AI visibility and ensures that your WordPress content continues to be consumed by LLMs exactly as you intend, upholding your digital content integrity.
Common llms.txt Directives for WordPress
| Directive | Purpose for AI | WordPress Application |
|---|---|---|
| User-agent: * | Applies rules to all AI models/agents. | Standard starting point for universal directives. |
| Disallow: /wp-admin/ | Prevents AI from accessing administration pages. | Protects sensitive backend areas from ingestion. |
| Allow: /blog/ | Explicitly permits AI to crawl specific content. | Highlights key content categories like your blog posts. |
| Crawl-delay: 5 | Requests AI to wait between requests (in seconds). | Manages server load, important for smaller hosts. |
| Citation-policy: /citation-guidelines.html | Points to a document detailing citation requirements. | Ensures proper attribution for your content. |
Essential WordPress llms.txt Pre-Launch Checklist
- Create `llms.txt` in a plain text editor, not a word processor.
- Upload `llms.txt` to your WordPress root directory (e.g., via SFTP).
- Verify `llms.txt` is accessible at `yourdomain.com/llms.txt`.
- Include `User-agent: *` to apply directives broadly.
- Review existing `robots.txt` for any conflicting directives.
- Add `Citation-policy:` to guide AI on proper content attribution.
Step-by-Step: Updating Your WordPress llms.txt
- 1Access Root Directory
Log into your hosting control panel or use an SFTP client to connect to your WordPress site's root folder where `wp-config.php` resides.
- 2Locate or Create File
Find `llms.txt`. If it doesn't exist, create a new plain text file and name it `llms.txt`.
- 3Edit Directives
Open `llms.txt` and add, modify, or remove directives according to your latest AI visibility strategy and content changes.
- 4Save & Verify Changes
Save the file and upload it, overwriting the old version if it existed. Immediately verify accessibility at `yourdomain.com/llms.txt` to confirm updates.
More questions answered
- Do I need both robots.txt and llms.txt for WordPress?
- Yes, `robots.txt` primarily guides traditional search engine crawlers (like Googlebot), while `llms.txt` is specifically for AI models and LLMs. They serve distinct purposes, and both are crucial for comprehensive visibility and control over how your WordPress content is accessed and processed by different automated agents.
- What happens if I don't have an llms.txt file?
- Without an `llms.txt` file, AI models may access and process your WordPress content without specific guidance, potentially leading to undesired outcomes. This could include scraping sensitive data, generating inaccurate summaries, or failing to properly cite your work, diminishing your AI visibility control and content integrity.
- Can I use a WordPress plugin for llms.txt?
- While some plugins offer `robots.txt` editing, very few specifically manage `llms.txt` yet. If a plugin allows direct editing of files in the root directory, it might work. Otherwise, manual SFTP/FTP upload or using your host's file manager remains the most reliable method for precise placement.
- How often should I update my llms.txt file?
- The frequency depends on your site's dynamics and AI model evolution. A good practice is to review it quarterly, or whenever you make significant changes to your WordPress site structure, content, or have new AI-related privacy or citation policies. Regular reviews ensure it remains aligned with your current AI visibility goals.
Explore further
Connected guides to keep going — short reads, all internally linked.