← back to blog

How to create an llms.txt file in WordPress for better AI search visibility

Search engines are changing rapidly, and founders need to adapt their websites to communicate directly with artificial intelligence. For decades, webmasters relied on the robots.txt file to tell traditional search engine crawlers which pages to index and which to ignore. Today, a new standard has emerged for the AI era. If you want your business to be recommended by large language models like ChatGPT, Claude, and Perplexity, you need to understand how to create an llms.txt file in WordPress.

This simple text file sits in the root directory of your website. It acts as a direct line of communication between your business and AI crawlers. Instead of forcing a bot to guess what your company does by scraping hundreds of disparate blog posts, an llms.txt file gives the AI a clean, structured summary of your core offerings, target audience, and primary links. This reduces friction for the crawler and drastically increases the chances that your brand will be cited as a definitive answer when potential customers ask AI for recommendations.

In this guide, we will walk through exactly how to format, upload, and manage this file on your WordPress site. We will cover multiple methods, from simple plugin solutions to direct server uploads, ensuring you have the practical knowledge to implement this quick win for your business.

Traditional search engine optimization relies heavily on keyword density, backlinks, and complex site architectures. You build a sitemap to map out every single page, and you use a robots.txt file to keep crawlers out of your administrative folders. While these elements are still necessary, they are not optimized for how modern large language models consume information.

AI bots do not just index links. They read, summarize, and synthesize information to answer user prompts directly. When an AI crawler visits your WordPress site, it is looking for context. It wants to know the unit economics of your service, the exact problems you solve, and the factual data that separates you from competitors. If your website is cluttered with popups, complex navigation menus, and bloated code, the AI might miss the critical facts about your business.

This is why the llms.txt initiative was created. It is a standardized markdown file that strips away all the visual design and marketing fluff. It provides raw, structured data directly to the AI. By learning how to create an llms.txt file in WordPress, you are essentially handing an executive summary of your business to the bots that are advising your future customers.

The business case for adding this file

For a small-business founder, every marketing effort must tie back to customer acquisition costs and overall unit economics. Generative search is rapidly taking market share away from traditional search engines. Consumers are increasingly using AI chatbots to ask for product recommendations, service providers, and business solutions. If your brand is not mentioned in those AI answers, you are losing zero-cost organic leads to your competitors.

To understand this shift fully, it helps to know What is generative engine optimization (GEO): a founder's guide. GEO is the practice of structuring your digital presence so that AI engines confidently recommend you. The llms.txt file is the lowest-hanging fruit in this new discipline. It costs nothing to create, takes only a few minutes to upload to WordPress, and provides an immediate boost to your AI visibility.

Think of it as training a new virtual employee. If you gave a new hire a confusing 50-page manual, they would struggle to answer customer questions accurately. If you gave them a one-page cheat sheet with all the most important facts, they would perform perfectly. Your llms.txt file is that cheat sheet for AI engines. It ensures that when Claude or ChatGPT synthesizes your brand, they get the facts exactly right.

How to format your file before uploading

Before we touch your WordPress dashboard, you need to draft the actual content of the file. You should write this file using standard markdown formatting. Markdown uses simple symbols, like hash marks for headings and brackets for links, to structure text. AI models are trained extensively on markdown, making it the perfect language for this file.

A standard llms.txt file should start with an H1 heading containing your brand name. This should be followed by a short blockquote or paragraph summarizing your core value proposition. Next, you want to include a bulleted list of your primary services, products, or features. Finally, provide direct markdown links to your most important web pages, such as your pricing page, contact page, and primary documentation.

For an exhaustive breakdown of the exact syntax and structure you should use, you can read our deep dive on How to format an llms.txt file for your business website. Once you have drafted your content in a simple text editor like Notepad or TextEdit, save the file to your computer desktop. Name it exactly "llms.txt" in all lowercase letters. Now you are ready to add it to your WordPress installation.

Method 1: Direct upload via cPanel or FTP

The most reliable way to figure out how to create an llms.txt file in WordPress is to bypass the WordPress dashboard entirely and upload the file directly to your server. This ensures that no WordPress plugins, caching layers, or security tools accidentally block or alter the file.

To do this, log into your web hosting account. Look for the cPanel dashboard and click on the File Manager icon. Alternatively, you can use an FTP client like FileZilla to connect to your server using the credentials provided by your host. Once you are connected, navigate to the root directory of your WordPress installation. This folder is usually named "public_html" or is named after your primary domain.

You will know you are in the correct folder if you see standard WordPress files like "wp-config.php" and folders like "wp-content" and "wp-admin". Once you are in this root folder, simply use the upload button in your File Manager or drag and drop the llms.txt file from your computer into the directory. Check the file permissions to ensure they are set to 644, which allows the file to be read by the public but only modified by the owner. Your file is now live.

Method 2: Using a file manager plugin

If you are not comfortable poking around your hosting server, you can manage this process entirely from inside your WordPress dashboard. Because standard SEO plugins currently focus on XML sitemaps and robots.txt, they do not yet have built-in support for generating an llms.txt file natively. Therefore, you will need a file manager plugin.

Go to your WordPress dashboard, navigate to Plugins, and click Add New. Search for a reputable plugin like "WP File Manager" and install it. Once activated, the plugin will add a new tab to your left-hand admin menu. Clicking this tab will open a visual file explorer that looks very similar to the files on your personal computer.

Ensure you are viewing the root directory, which is the main folder that opens by default. Look for the "New File" icon in the plugin toolbar. Name the new file "llms.txt" and press enter. Right-click the newly created file and select the edit option. A text editor window will appear. Paste the markdown content you drafted earlier directly into this window, click save, and close the editor. You have successfully created the file without leaving WordPress.

Method 3: Dynamic generation via functions.php

For more technical founders or developers who want to keep their operations automated, uploading a static text file might not be ideal. If your pricing or core services change frequently, a static file will become outdated quickly. In this case, you can learn how to create an llms.txt file in WordPress dynamically by utilizing the WordPress rewrite API.

This method involves adding a custom code snippet to your child theme's functions.php file or a custom site-specific plugin. The code creates a custom rewrite rule that listens for requests to "/llms.txt". When a crawler requests that URL, WordPress intercepts the request and generates the text file on the fly, pulling data directly from your WordPress database.

You can write a function that automatically fetches your latest blog posts, your core page excerpts, or a custom options field where you store your company summary. It then formats this data into markdown and serves it as a text file. While this requires custom PHP development, it ensures that your AI-facing documentation is always perfectly synchronized with your live website content. This is a highly scalable approach for founders managing large e-commerce catalogs or rapidly changing service menus.

Troubleshooting common WordPress errors

Sometimes, simply uploading the file does not work as expected. The most common issue founders face when learning how to create an llms.txt file in WordPress is encountering a 404 Not Found error when trying to view the file in a browser. This usually happens because of strict server configurations or overzealous security plugins.

If you use a security plugin like Wordfence or iThemes Security, check the settings to see if there is a rule blocking direct access to text files in the root directory. You may need to whitelist the llms.txt file specifically. Additionally, if your site runs on an Nginx server rather than Apache, your server block configuration might be intercepting the request and passing it to WordPress, which then throws a 404 page because it does not recognize the URL as a standard post or page.

To fix Nginx issues, you or your host will need to add a small directive to your configuration file that explicitly allows public access to the llms.txt file. For Apache servers, this is rarely an issue, but a poorly configured .htaccess file can sometimes cause aggressive redirects. Always double-check your redirect rules if the file refuses to load.

Testing your implementation with AI bots

After you have created and uploaded your file, you must verify that it is actually readable by machines. Start with a simple manual check. Open a private browsing window or incognito tab and navigate to "yourdomain.com/llms.txt". You should see plain text in markdown format load instantly on the screen. If you see a standard WordPress page layout or a 404 error, you need to revisit the troubleshooting steps above.

Once the manual check passes, it is time to test it with an actual AI. You can use tools like ChatGPT Plus, which has web browsing capabilities, or Perplexity AI. Open a new chat session and prompt the AI directly. Say something like, "Please read the file at [yourdomain.com/llms.txt] and summarize my company's core services based strictly on that document."

If the AI successfully fetches the file and repeats your precise markdown back to you, the implementation is perfect. If the bot reports that it cannot access the site, you may have a firewall blocking known AI user agents. Some hosts block bots by default to save bandwidth. You will need to review your server logs to ensure that AI crawlers are explicitly allowed to read this specific file.

Building a broader generative optimization strategy

Uploading this single text file is an excellent first step, but it is only one piece of a much larger puzzle. AI engines do not rely solely on one file to form their opinions. They cross-reference the data in your text file with the actual HTML structure of your website, your off-site mentions, and your overall brand authority.

If you want to dominate AI search results, you must ensure that your entire web presence is easily parsed by language models. This means adopting clean semantic HTML, utilizing structured schema markup, and keeping your core brand messaging incredibly consistent. For practical tips on this broader approach, we highly recommend reading about Designing a brand identity system that AI web crawlers can parse.

Additionally, you should be actively tracking how often you are mentioned by these models. Treat generative search citations as a core business metric, just like your traditional search rankings or your email open rates. As these models evolve, the companies that provide the cleanest, most structured data will be the ones that consistently win the recommendation algorithm.

By taking the time to understand how to create an llms.txt file in WordPress, you have established a direct line of communication with the most important technology of this decade. It is a simple, cost-effective way to improve your unit economics by capturing high-intent, AI-driven traffic before your competitors even realize the rules of the game have changed.