·8 min read

How to Add llms.txt to WordPress: 4 Simple Methods (2025)

Adding llms.txt to WordPress

WordPress powers over 43% of all websites on the internet, which means millions of site owners are looking for ways to make their content more accessible to AI systems. If you're running a WordPress site and want to implement the llms.txt standard, you're in the right place.

The good news? Adding llms.txt to WordPress is straightforward, even if you're not particularly technical. You have several options ranging from one-click plugin installations to more customized approaches.

In this guide, I'll walk you through four different methods to add llms.txt to your WordPress site, explain the pros and cons of each approach, and help you choose the right one for your needs.

Why Add llms.txt to Your WordPress Site?

Before we get into the how, let's quickly cover the why. The llms.txt file helps AI systems like Claude, ChatGPT, and Perplexity understand and navigate your content more effectively.

For WordPress sites specifically, this means:

  • Better AI representation: When users ask AI assistants about topics you cover, your content is more likely to be accurately represented
  • Improved discoverability: AI-powered search engines can better index and surface your content
  • Future-proofing: As AI continues to reshape how people find information online, having llms.txt positions you ahead of the curve
  • Enhanced documentation: If you run a business or product site, AI systems can better understand your offerings

Now, let's look at the different ways you can implement this on your WordPress site.

Method 1: Use a Dedicated Plugin (Easiest)

The simplest way to add llms.txt to WordPress is using a plugin specifically designed for this purpose. This method requires no coding knowledge and can be set up in minutes.

The most popular option is the Website LLMs.txt plugin, which has over 10,000 active installations and is actively maintained.

Installation steps:

  1. Log in to your WordPress admin dashboard
  2. Go to PluginsAdd New
  3. Search for "Website LLMs.txt"
  4. Click Install Now on the plugin by DavidMarks
  5. Click Activate

Once activated, the plugin automatically generates both llms.txt and llms-full.txt files at your domain root.

Key features:

  • Automatic generation of both standard and full versions
  • Respects your SEO plugin settings (works with Yoast, Rank Math, and All in One SEO)
  • Honors noindex directives automatically
  • Per-page exclusion options
  • No configuration required for basic use
  • Works on restricted hosting environments through virtual serving

Pros:

  • Zero technical knowledge required
  • Automatic updates when you publish new content
  • Respects existing SEO settings
  • Free to use

Cons:

  • Less customization control
  • Adds another plugin to your site
  • File structure follows plugin defaults

To check if it's working, simply visit yoursite.com/llms.txt in your browser. You should see a formatted text file with your site's content structure.

Method 2: Use Your SEO Plugin

If you're already using a popular SEO plugin, you might not need an additional plugin at all. Several major SEO plugins have built-in llms.txt generation.

Yoast SEO

Yoast SEO added native llms.txt support in recent versions.

  1. Go to SEOGeneral in your WordPress dashboard
  2. Click the Features tab
  3. Scroll to find "llms.txt" or "AI Search" settings
  4. Toggle it On
  5. Save changes

The feature is available in both the free and premium versions of Yoast.

All in One SEO (AIOSEO)

All in One SEO also includes llms.txt generation in their free version.

  1. Navigate to All in One SEOGeneral Settings
  2. Go to the Advanced section
  3. Find the "llms.txt" option
  4. Enable it and configure any settings
  5. Save your changes

Rank Math

While Rank Math doesn't currently have built-in llms.txt support as of this writing, it's worth checking if they've added it in recent updates, as they're known for rapid feature development.

Pros

  • No additional plugin needed
  • Integrated with your existing SEO workflow
  • Auto-updates weekly
  • Respects your existing SEO settings automatically

Cons

  • Limited to the structure your SEO plugin provides
  • Requires you to already be using one of these plugins
  • May not offer as much customization as dedicated solutions

Method 3: Manual Upload via FTP or cPanel (Most Control)

If you want complete control over your llms.txt file's content and structure, manually creating and uploading it is your best bet. This method is perfect if you want to customize exactly what appears in your file.

Step 1: Create Your llms.txt File

First, you need to create the actual file. You can do this in two ways:

Option A: Use our generator

The fastest way is to use our free generator:

Simply input your WordPress site's URL and key pages, and our tool will create a properly formatted llms.txt file you can download.

Option B: Create it manually

Open a plain text editor (Notepad on Windows, TextEdit on Mac in plain text mode, or any code editor) and create your file following the llms.txt format:

# Your WordPress Site Name

> Brief description of what your site is about

## Blog Posts
- [Post Title 1](https://yoursite.com/post-1): Brief description
- [Post Title 2](https://yoursite.com/post-2): Brief description

## Pages
- [About](https://yoursite.com/about): Information about your site
- [Contact](https://yoursite.com/contact): How to reach you

## Resources
- [Documentation](https://yoursite.com/docs): Helpful guides and tutorials

Save this as llms.txt (not llms.txt.txt – make sure file extensions are visible).

Step 2: Upload the File

Via FTP:

  1. Connect to your site using an FTP client like FileZilla
  2. Navigate to your WordPress root directory (usually public_html or www)
  3. Upload your llms.txt file to this root directory
  4. Set file permissions to 644 if needed

Via cPanel File Manager:

  1. Log in to your hosting cPanel
  2. Open File Manager
  3. Navigate to your WordPress root directory (usually public_html)
  4. Click Upload and select your llms.txt file
  5. Wait for the upload to complete

Step 3: Verify It Works

Visit yoursite.com/llms.txt in your browser. You should see your file displayed as plain text.

Pros:

  • Complete control over content and structure
  • No plugins needed
  • Lightweight approach
  • Can include exactly what you want

Cons:

  • Requires manual updates when content changes
  • Need FTP or cPanel access
  • More technical than plugin methods
  • Must understand the llms.txt format

Method 4: Custom Code Implementation (For Developers)

If you're comfortable with PHP and want programmatic control over your llms.txt file, you can add custom code to your WordPress theme. This method is ideal for developers who want to dynamically generate the file based on their WordPress content.

Adding Code to functions.php

Add this code to your theme's functions.php file or create a custom plugin.

<?php
// Add rewrite rule for llms.txt
function add_llms_txt_rewrite() {
    add_rewrite_rule('^llms\.txt$', 'index.php?llms_txt=1', 'top');
    add_rewrite_tag('%llms_txt%', '([^&]+)');
}
add_action('init', 'add_llms_txt_rewrite');

// Generate llms.txt content
function generate_llms_txt() {
    if (get_query_var('llms_txt')) {
        header('Content-Type: text/plain; charset=utf-8');
        
        $site_name = get_bloginfo('name');
        $site_description = get_bloginfo('description');
        $site_url = get_site_url();
        
        // Start output
        echo "# {$site_name}\n\n";
        echo "> {$site_description}\n\n";
        
        // Get recent posts
        $posts = get_posts(array(
            'numberposts' => 20,
            'post_status' => 'publish',
            'orderby' => 'date',
            'order' => 'DESC'
        ));
        
        if (!empty($posts)) {
            echo "## Blog Posts\n";
            foreach ($posts as $post) {
                $title = esc_html($post->post_title);
                $url = get_permalink($post->ID);
                $excerpt = wp_trim_words($post->post_excerpt ?: $post->post_content, 15);
                echo "- [{$title}]({$url}): {$excerpt}\n";
            }
            echo "\n";
        }
        
        // Get pages
        $pages = get_pages(array(
            'sort_column' => 'menu_order',
            'post_status' => 'publish'
        ));
        
        if (!empty($pages)) {
            echo "## Pages\n";
            foreach ($pages as $page) {
                $title = esc_html($page->post_title);
                $url = get_permalink($page->ID);
                $excerpt = wp_trim_words($page->post_excerpt ?: $page->post_content, 15);
                echo "- [{$title}]({$url}): {$excerpt}\n";
            }
        }
        
        exit;
    }
}
add_action('template_redirect', 'generate_llms_txt');

// Prevent WordPress from redirecting /llms.txt to /llms.txt/
function prevent_llms_txt_redirect($redirect_url, $requested_url) {
    if (strpos(strtolower(parse_url($redirect_url, PHP_URL_PATH)), 'llms.txt') !== false) {
        return false;
    }
    return $redirect_url;
}
add_filter('redirect_canonical', 'prevent_llms_txt_redirect', 10, 2);
?>

Important: Flush Rewrite Rules

After adding this code, you must flush your rewrite rules.

  1. Go to SettingsPermalinks in your WordPress dashboard
  2. Don't change anything – just click Save Changes
  3. This refreshes WordPress's URL routing

Choosing the Right Method for Your WordPress Site

Here's a quick decision guide to help you pick the best method.

Choose Method 1 (Plugin) if:

  • You want the quickest setup
  • You're not comfortable with code
  • You want automatic updates
  • You don't need heavy customization

Choose Method 2 (SEO Plugin) if:

  • You already use Yoast or AIOSEO
  • You want minimal plugin overhead
  • You're happy with automated content selection
  • You want integration with your SEO workflow

Choose Method 3 (Manual Upload) if:

  • You want complete control over content
  • You have FTP or cPanel access
  • Your site content doesn't change often
  • You want the lightest-weight solution

Choose Method 4 (Custom Code) if:

  • You're a developer or comfortable with PHP
  • You need dynamic content generation
  • You want to integrate with custom post types
  • You need advanced filtering or logic

Testing Your Implementation

Regardless of which method you choose, testing is crucial. Here's how to verify everything works correctly.

1. Basic Access Test

Visit yoursite.com/llms.txt in your browser. You should see:

  • Plain text format (not HTML)
  • Your site name as the H1 heading
  • Properly formatted markdown
  • Working links to your content

2. Format Validation

Use our llms.txt validator to check your file's structure and ensure it follows the standard correctly.

3. Content Accuracy

Review the content to make sure:

  • All links work correctly
  • Descriptions are accurate
  • Important pages aren't missing
  • You haven't accidentally included draft or private content

4. Header Check

Use curl or your browser's developer tools to verify the correct MIME type.

curl -I https://yoursite.com/llms.txt

You should see: Content-Type: text/plain; charset=utf-8

5. AI System Test

The ultimate test is using it with an actual AI system.

  1. Upload your llms.txt to Claude or ChatGPT
  2. Ask questions about your site
  3. Verify the AI correctly understands your content structure
  4. Check if important information is accessible

Advanced Tips for WordPress Users

Once you have the basics working, consider adding these improvements.

1. Include Custom Post Types

If you use custom post types (like portfolios, products, or testimonials), make sure they're included in your llms.txt. Plugin users should check plugin settings; custom code users can modify their query:

$args = array(
    'post_type' => array('post', 'page', 'portfolio', 'product'),
    'post_status' => 'publish',
    'posts_per_page' => -1
);

2. Organize by Category

For blogs with diverse content, organizing by category can help AI systems understand your site structure better:

## Marketing Guides
- [SEO Basics](https://yoursite.com/seo-basics): Complete SEO guide for beginners
- [Content Strategy](https://yoursite.com/content-strategy): How to plan your content

## Development Tutorials
- [WordPress Basics](https://yoursite.com/wp-basics): Getting started with WordPress
- [Theme Development](https://yoursite.com/theme-dev): Build custom WordPress themes

3. Respect User Privacy

Make sure not to include:

  • Membership or login-protected content URLs
  • Draft or private pages
  • Author or user profile pages (unless public-facing)
  • Any sensitive information

4. Create llms-full.txt Too

Consider adding the full-content version alongside your standard file. Most plugins generate this automatically, but manual users should create an llms-full.txt that includes complete page content.

The Future of llms.txt in WordPress

The WordPress ecosystem is rapidly adopting AI-friendly standards. We're likely to see the following things to happen.

  • More SEO plugins adding built-in support
  • Better integration with WordPress's block editor
  • Automatic generation based on site structure
  • Enhanced customization options in page/post editors
  • Integration with WordPress's REST API

As AI-powered search becomes more prevalent, having llms.txt on your WordPress site will shift from "nice to have" to "essential." Getting it set up now puts you ahead of the curve.

Conclusion

Adding llms.txt to your WordPress site doesn't have to be complicated. Whether you choose a one-click plugin, leverage your existing SEO tools, manually upload a file, or implement custom code, you can have this important AI optimization in place within minutes.

The key is choosing the method that matches your technical comfort level and maintenance preferences. For most WordPress users, I recommend starting with the plugin approach – it's quick, requires no technical knowledge, and handles updates automatically.

Once you have your llms.txt file live, make sure to test it with actual AI systems and update it regularly as your content grows. This simple addition helps ensure AI systems can accurately understand and represent your WordPress site's content to users around the world.

Ready to make your WordPress site AI-friendly? Our free tool can help you generate a properly formatted llms.txt file in seconds:

Have questions about implementing llms.txt on WordPress? Check out our FAQ page or reach out to us – we're here to help!

Share this article

Read more