---
title: "llms.txt for Next.js, WordPress and Shopify: Add One"
description: "Create an llms.txt file: the llmstxt.org format, a real example, code for Next.js, WordPress, Shopify and static sites, llms-full.txt and the evidence."
url: https://seenlens.com/fixes/add-llms-txt
last_updated: 2026-11-06
---

# llms.txt: how to create one for Next.js, WordPress, Shopify and static sites

An llms.txt file is a Markdown file at /llms.txt that lists your key pages for AI tools. Google Search does not use it, and a large study found most files get no AI requests. Lighthouse still checks it, so audits flag a broken one. Creating a file takes about 20 minutes. SeenLens reports info when the file is missing and warns when it is broken.

By SeenLens. Last updated: 2026-11-06

## What does the llms.txt check test?

SeenLens requests `/llms.txt` and `/llms-full.txt`. The check follows the Lighthouse llms.txt audit and adds notes from the llmstxt.org format.

| What SeenLens finds | Result |
| --- | --- |
| A 4xx answer such as 404 | Info. The file is optional, and Lighthouse treats a 404 as not applicable. |
| A 5xx answer, or the request fails | Fail |
| Status 200 with an H1 line, at least one Markdown link and 50 or more characters | Pass |
| Status 200 but one of those three is missing | Warn |
| Status 200 with an HTML page, which means a catch-all route answers the path | Warn. See [soft 404 pages](https://seenlens.com/fixes/soft-404-unknown-urls). |

Three findings appear as notes only: the H1 is not the first line, there is no blockquote summary, and there are no H2 sections.

## Does llms.txt work?

Google says Google Search does not use llms.txt files, and that you do not need them to appear in Search or in its generative AI features. Lighthouse has an llms.txt audit, and the Chrome documentation calls the file optional at the moment.

Ahrefs studied 137,210 domains that had traffic in May 2026 (published 2026-06-15). About 28% published an llms.txt file, and about 97% of those files received no requests that month. AI retrieval bots made up 1.1% of the requests. This is a vendor study of Ahrefs customers, and the authors call the adoption number an upper bound.

Publish the file if you can keep it accurate at low cost. Do not expect more AI traffic from it. See [does llms.txt work](https://seenlens.com/guides/does-llms-txt-work) and [what is llms.txt](https://seenlens.com/glossary/llms-txt).

## What goes in an llms.txt file?

The llmstxt.org proposal (by Jeremy Howard, published 2024-09-03) defines the file in this order.

1. An H1 with the name of the site or project. This is the only required element.
2. A blockquote with a short summary.
3. Optional paragraphs or lists with more detail. They must not contain headings.
4. Zero or more H2 sections that hold lists of links. Each item is a Markdown link, optionally followed by a colon and a note.
5. An H2 section named Optional for links an agent can skip when it needs less context.

This is the start of the real SeenLens file, taken from https://seenlens.com/llms.txt on 2026-11-06.

```text
# SeenLens

> SeenLens scans one page URL and reports how visible the site is to AI search engines and to AI agents that browse the web. The scan is free and needs no account.

Every page below is also available as Markdown: add .md to the path (for example https://seenlens.com/pricing.md) or send Accept: text/markdown.

## Product

- [Pricing](https://seenlens.com/pricing): Free scan, plus the AI Visibility Report at USD 49 one-time per URL with a 7-day money-back guarantee.
- [How it works](https://seenlens.com/how-it-works): Methodology: the five dimensions, all 43 checks, scoring weights, and what is not tested yet.

## Optional

- [llms-full.txt](https://seenlens.com/llms-full.txt): Full text of the methodology and pricing pages in one file.
```

Use absolute URLs, a short note after each link, and only pages that return status 200. The file may sit at a subpath too, where it covers the URLs under it.

## How do I add llms.txt?

Serve the file at `/llms.txt` with status 200 and a text type such as `text/plain; charset=utf-8` or `text/markdown`.

### Next.js App Router

The simplest way is a file named `llms.txt` in the `public` folder. Next.js serves it at `/llms.txt`. To build the file from your content, use a route handler. This is how SeenLens does it. The folder name `llms.txt` is valid for a route, in the same way as `rss.xml` in the Next.js documentation.

```text
import { buildLlmsTxt } from "@/lib/llms";

export const dynamic = "force-static";

export function GET() {
  return new Response(buildLlmsTxt(), {
    headers: { "Content-Type": "text/plain; charset=utf-8" },
  });
}
```

`force-static` builds the file once at build time. `buildLlmsTxt()` is a function you write: it returns the Markdown string from your page list.

### WordPress

Yoast SEO has a built-in llms.txt feature that its product page calls free. By default it picks key content, and a manual mode lets you choose the pages. Turn it on in the plugin's site feature settings, then open `/llms.txt` on your site to confirm it is served. Without a plugin, upload the file to the site root, the folder that holds `wp-config.php`.

### Shopify

Shopify's theme documentation lists `llms.txt.liquid` and `llms-full.txt.liquid` as special templates that render `/llms.txt` and `/llms-full.txt`. They must be Liquid templates, not JSON templates. Create `templates/llms.txt.liquid` in the theme code editor and write the Markdown inside it. Open `/llms.txt` after saving and check the content type.

```text
# {{ shop.name }}

> A short summary of the store: what it sells and who it serves.

## Pages

- [Shipping](https://example.com/pages/shipping): Delivery times and costs.
```

### Static sites and Nginx

Put `llms.txt` in the web root. To set the type and charset in Nginx, add a location block. Then check that a made up path such as `/no-such-file` still returns 404.

```text
location = /llms.txt {
    default_type text/plain;
    charset utf-8;
}
```

## llms-full.txt vs llms.txt: what is the difference?

The llmstxt.org page describes only `llms.txt`. The name `llms-full.txt` is a convention used by documentation sites. It holds the full text of your key pages in one Markdown file, so a tool can load everything in one request. `llms.txt` is the index with links. `llms-full.txt` is the content itself.

SeenLens publishes both. Its `llms.txt` lists `llms-full.txt` in the Optional section, and the SeenLens check records whether `/llms-full.txt` exists. Generate it from the same source as your pages, so the two never differ.

## How do I verify the fix?

```text
curl -sI https://example.com/llms.txt | head -5
curl -s https://example.com/llms.txt | head -10
```

1. The first command must show `200` and a text content type.
2. The second must print a line that starts with `# ` and at least one link.
3. Run the llms.txt checker above. It checks the structure and tests up to 10 linked URLs for status 200.

## When can I skip llms.txt?

The file is optional. If you do not want to maintain one, return a real 404 for `/llms.txt`. SeenLens reports that as info, which earns half credit on a check with weight 3 in the agent readiness dimension. Never leave a catch-all route that answers `/llms.txt` with an HTML page and status 200. That state shows as a warning.

[Scan your page with SeenLens](https://seenlens.com/)

## Which checks are related?

- [Serve Markdown to agents](https://seenlens.com/fixes/serve-markdown-to-agents) covers Markdown versions of each page.
- [Soft 404 pages](https://seenlens.com/fixes/soft-404-unknown-urls) covers catch-all routes that answer missing files.
- [Lighthouse agentic audit failures](https://seenlens.com/fixes/lighthouse-agentic-audit-failures) covers the Lighthouse view of this file.

## Sources

- [llms.txt proposal](https://llmstxt.org/) (file format, location and ordering; published 2024-09-03, modified 2026-08-10; checked 2026-11-06)
- [Google Search Central: Optimizing your website for generative AI features](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide) (Google Search does not use llms.txt; checked 2026-11-06)
- [Chrome for Developers: llms.txt audit](https://developer.chrome.com/docs/lighthouse/agentic-browsing/llms-txt) (a 404 is not applicable; file optional; checked 2026-11-06)
- [Lighthouse 13.6.0 source, llms-txt audit](https://unpkg.com/lighthouse@13.6.0/core/audits/agentic/llms-txt.js) (H1, link and 50 character rules; checked 2026-11-06)
- [Ahrefs: llms.txt study](https://ahrefs.com/blog/llmstxt-study/) (137,210 domains, published 2026-06-15; vendor study; checked 2026-11-06)
- [Shopify: theme templates](https://shopify.dev/docs/storefronts/themes/architecture/templates) (llms.txt.liquid and llms-full.txt.liquid; checked 2026-11-06)
- [Yoast: llms.txt feature](https://yoast.com/features/llms-txt/) (built-in generator, automatic and manual modes; checked 2026-11-06)
- [Next.js docs: route.js](https://nextjs.org/docs/app/api-reference/file-conventions/route) (route handlers for non-UI responses; page updated 2026-04-30; checked 2026-11-06)
