---
title: "llms.txt returns 404 not found, how to fix it"
url: https://hostmy.blog/docs/rankready/llms-txt-404-fix/
date: 2026-08-24
modified: 2026-08-25
lang: en
author: "Aditya Sharma"
description: "Turn a 404 on /llms.txt into a working file, from the feature toggle through stale rewrite rules to cached error responses."
word_count: 816
---

# llms.txt returns 404 not found, how to fix it

You will end this page with `/llms.txt` returning 200 and serving your AI index. The same fixes apply to `/llms-full.txt`, `/index.md`, individual post Markdown URLs and `/okf/`, because all of them reach WordPress by the same route.

## What you are seeing

You load `https://example.com/llms.txt` and WordPress shows your theme's 404 page, or the request returns HTTP 404 to a command line client. The RankReady settings screen shows the feature switched on, which makes the 404 look like a plugin failure.

## Why it happens

`/llms.txt` is not a file on disk. RankReady registers it as a WordPress rewrite rule and builds the response when the request arrives. A 404 means the request never reached RankReady's handler. There are five realistic reasons for that:

- The feature is switched off, so nothing is registered.
- WordPress is running with a stale set of rewrite rules that predate the toggle.
- Your permalink structure is Plain, so WordPress has no pretty rewrite rules at all.
- Something on the stack claimed the request before RankReady saw it. LiteSpeed running alongside [Rank Math](https://hostmy.blog/docs/rankready/rankready-with-yoast-rankmath-aioseo/) was the reported combination.
- A page cache or CDN stored the earlier 404 and is still serving that stored copy.

![RankReady llms.txt settings screen under the AI Visibility tab](https://hostmy.blog/wp-content/uploads/2026/08/rr-llms-txt-v2-scaled.png)The llms.txt controls sit under AI Visibility, subtab llms.

## 1. Confirm the feature is on

Open **RankReady > AI Visibility** and select the **llms.txt** subtab. In the URL that is `tab=crawlers&sub=llms`. Check the toggle, then click Save even if it already looks correct. A 404 with the toggle off is the plugin behaving as designed, not a bug.

## 2. Re-save your permalinks

Go to **Settings > Permalinks** and click **Save Changes**. You do not have to change anything. Saving forces WordPress to rebuild its rewrite rules and pick up the ones RankReady registers. This single step resolves most 404s on these endpoints.

While you are on that screen, check that the structure is not set to Plain. Rewrite based endpoints such as `/llms.txt` and `/post-slug.md` need a pretty permalink structure to exist at all.

## 3. Update to 1.3.0

On some stacks the rewrite rule is intercepted before WordPress can match it, and re-saving permalinks does not help because the rule is fine, it is just never consulted. RankReady 1.3.0 adds a fallback that inspects the raw request path, so the endpoint is recognised even when the rewrite rule has been taken over.

1.3.0 also cleans up after itself when you switch a feature off. Older versions could leave a stale rule in place that produced a raw 404 rather than a clean response. If you are below 1.3.0, update first, then repeat step 2.

## 4. Clear every layer of cache

A 404 is a normal cacheable response. If you fixed the underlying cause but the error persists, you are probably reading a stored copy of the old answer. Purge your page cache plugin, purge your CDN, then retest in a private browser window so no browser cache is involved.

Once the endpoint is serving correctly, revalidation is cheap: `/llms.txt` and `/okf/` both support ETag and answer `304 Not Modified` to a conditional request with `If-None-Match`.

## 5. Rule out a conflict or a real file

If the endpoint still 404s, check whether a real file named `llms.txt` exists in your web root. A file on disk is served by the web server before WordPress is ever loaded, and it will shadow the generated response.

After that, bisect. Switch your theme to a default WordPress theme and retest. Then deactivate other plugins in small groups, retesting after each group, until the endpoint returns. Re-save permalinks after each change, because plugin activation state and rewrite rules interact.

## Verify the fix

Test from a command line rather than a browser tab, so you see the status code rather than a rendered page:

`curl -I https://example.com/llms.txt
curl -I https://example.com/llms-full.txt
curl -I https://example.com/index.md
curl -I https://example.com/okf/`
Each should return `HTTP/1.1 200`. Then open `/llms.txt` in a browser and confirm the content matches your site, including the entries you expect to see listed.

To test a single post as Markdown, take a real post URL and append `.md` to the slug, for example `https://example.com/my-post.md`. Distinct `.md` URLs always [serve Markdown](https://hostmy.blog/docs/rankready/wordpress-markdown-for-ai/) regardless of the Accept header. That is deliberate, and it is what makes them safe to cache.

## One endpoint that this page will not fix

If `/llms.txt` now works but `/.well-known/mcp.json` still fails, look at the status code. A 403 there is a different problem with a different cause: nginx blocks dotfile paths by default, and no plugin setting can override a server rule. That needs a change to your server configuration, covered in its own guide.

## Still stuck

Collect three things before asking for help: the exact URL you tested, the full response headers from `curl -I`, and your WordPress version, PHP version and web server. RankReady 1.3.0 requires WordPress 6.9 or newer and PHP 7.4 or newer, and an unsupported version is worth ruling out early.