Guides

Add llms.txt and a sitemap on WordPress

How do I add an llms.txt file to WordPress?

Two files matter here, and on WordPress you almost certainly have one of them already and can switch the other on in a single click. Check what you have before you upload anything. The commonest way to go wrong on this finding is to replace a good sitemap with a worse one.

Check what you already have

Open both of these in a browser before you change a thing.

  • yourdomain.com/sitemap.xml If a list of addresses loads, you have a sitemap. WordPress has generated one at /wp-sitemap.xml since version 5.5, and Yoast, Rank Math and All in One SEO each replace it with their own.

  • yourdomain.com/llms.txt If text loads, you have one of those too, and your question is which pages it lists rather than how to create it. Skip to the section below.

If you do have a sitemap, the one thing worth adding is its address on the last line of your robots.txt, so that anything reading that file finds it.

Sitemap: https://yourdomain.com/sitemap.xml

Yoast already has llms.txt, and it is switched off

If you run Yoast there is nothing to upload. Go to Yoast SEO, then Settings, then Site features, and look under AI tools. The feature is built in, it is free, and it is off until somebody turns it on, which is why most WordPress sites have no llms.txt rather than a bad one.

Yoast SEO, Settings, Site features. llms.txt sits under AI tools, switched off.
Yoast SEO, Settings, Site features. llms.txt sits under AI tools, switched off.

Turn it on, then open yourdomain.com/llms.txt to confirm it answers.

Choosing which pages it lists

This is the part worth your attention, because the default is a guess. Yoast picks the pages for you unless you tell it otherwise.

The llms.txt panel: turn the file on, then choose automatic or manual page selection.
The llms.txt panel: turn the file on, then choose automatic or manual page selection.

On a seven page demo site for a plumbing company, the automatic pick left out Boiler installation and Bathroom fitting: two of the services a customer would actually search for. Choose Manual page selection and name the pages you sell from, rather than letting an algorithm guess which of your pages matter to your business.

Manual page selection, naming the about, contact and service pages by hand.
Manual page selection, naming the about, contact and service pages by hand.

If you have no SEO plugin

WordPress is one of the few platforms where you can genuinely put a file at your own root.

  1. Save the Fix Pack file as plain text, named exactly llms.txt. A text editor, not a word processor, and check your operating system has not added a second extension.

  2. Open your host file manager, or connect over FTP. Most hosts put this under Files or File Manager in the control panel.

  3. Put it in the folder that contains wp-config.php. That folder is your site root. Not wp-content, and not a theme folder.

  4. Open yourdomain.com/llms.txt in a browser. It should display as text rather than downloading.

Checking it worked

Open yourdomain.com/llms.txt and read the list. Do not take the settings screen at its word: on one site the page picker showed the page that had been chosen and saved nothing at all, and reading the published file was the only way to see it.

A caching plugin will happily serve the old file for a while, so clear the cache before you decide it did not work.

If your screens do not look like this, the wording has moved rather than the setting. Search your platform for the words in bold above. If you still cannot find it, send us the scan link and we will tell you where it is on your setup.

Was this page helpful?

Still stuck? Send us a message. A scan link in it makes it much faster to answer.