On Next.js App Router, the simplest way to publish llms.txt is to place llms.txt and llms-full.txt in the public/ folder so they resolve at /llms.txt and /llms-full.txt on every deploy. Alternatively, add app/llms.txt/route.ts (and llms-full.txt) that returns text/plain Markdown. Generate a first draft with a free generator, review it, commit the files, and redeploy. llms.txt remains an emerging convention — not a proven citation lever.
What are the key takeaways?
Next.js App Router sites can ship llms.txt as static files in public/ or as Route Handlers that return text/plain — both resolve at the site root after deploy.
- Easiest path: public/llms.txt + public/llms-full.txt.
- Dynamic path: app/llms.txt/route.ts returning Markdown with Content-Type: text/plain.
- Generate a draft with the free generator, then commit reviewed files.
- Keep robots.txt and crawlable HTML healthy first.
- No published proof that llms.txt alone increases AI citations.
How do you deploy llms.txt from the public folder?
Create public/llms.txt and public/llms-full.txt in your Next.js project. Anything in public/ is served from the site root, so production will expose https://yourdomain.com/llms.txt after the next deploy.
This matches how many docs and marketing sites publish the llmstxt.org proposal: static Markdown, no runtime work.
- 1Generate or write valid Markdown for both files.
- 2Save them as public/llms.txt and public/llms-full.txt.
- 3Deploy (Vercel, Node host, or your usual pipeline).
- 4Confirm the live URLs return 200 and text/plain or text/markdown.
When should you use a Route Handler instead?
Use a Route Handler when the map should be generated at build or request time from a content source — for example a CMS or MDX inventory — so you do not hand-edit Markdown on every content change.
A minimal handler returns new Response(markdown, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) from app/llms.txt/route.ts. Prefer caching or build-time generation over regenerating on every cold request for large sites.
How do you generate the Markdown for a Next.js site?
Paste your production URL into the free llms.txt generator. It discovers up to 20 pages, groups them into sections, and returns both files plus deployment notes. Review titles and descriptions before you commit — generation is a draft. Larger App Router sites can continue on AEOForged for a deep ranked scan.
For docs-heavy App Router sites, also read llms.txt for documentation sites and wire regeneration into CI when the docs source of truth changes.
What should you measure after deploy?
Confirm /llms.txt and /robots.txt resolve, then check whether AI bots can fetch and extract your important pages. Publishing a map does not fix client-only shells or blocked paths.
AEOForged measures crawlability and extractability and can produce install-ready AI operability files after a deeper map. This free site stays focused on the ≤20-page draft.
Frequently asked questions
Where do I put llms.txt in a Next.js App Router project?+
The simplest option is public/llms.txt (and public/llms-full.txt) so Next serves them at the site root. You can also add Route Handlers under app/llms.txt/route.ts that return text/plain Markdown.
Does Vercel need special config for llms.txt?+
No special config for static files in public/. After deploy, open https://yourdomain.com/llms.txt and confirm a 200 response. Route Handlers work like any other App Router route.
Will llms.txt improve my Next.js site's AI rankings?+
There is no public controlled evidence that it does. Treat it as optional hygiene after robots.txt and crawlable HTML are correct — not a guaranteed ranking or citation lever.