Back to Blog

How to Add llms.txt β€” Complete Guide for Every Platform (2026)

One guide that covers all platforms: Next.js, Nuxt, Astro, Gatsby, Remix, WordPress, Webflow, Shopify, Framer, Ghost, Hugo, Squarespace, and Wix. Find your platform, follow the steps, and be done in under five minutes.

LLMs.txt GeneratorMay 23, 20268 min read23 views
How to Add llms.txt β€” Complete Guide for Every Platform (2026)

llms.txt is a plain-text file at your domain root that tells AI crawlers β€” ChatGPT, Claude, Perplexity β€” which pages to prioritize when indexing your site. Adding it takes under five minutes. The process differs by platform.

This guide covers every major platform. Find yours below, follow the step-by-step instructions, and link back here if you need to add a second site on a different stack.

Which Guide Do You Need?

Your platform Approach Difficulty
Next.js Route handler or static file Easy
Nuxt.js Server route or public folder Easy
Astro Static file in /public Very easy
Gatsby Static file in /static Very easy
Remix Route file returning plain text Easy
WordPress Upload via File Manager or FTP (no plugin needed) Easy
Webflow Hosting > Publish > Custom files Easy
Shopify Theme files or Custom liquid Moderate
Framer CMS or custom code upload Easy
Ghost / Hugo / static sites Place in root directory or server Very easy
Squarespace / Wix Code injection or developer mode Moderate
SaaS products Structured for AI discovery Varies

Step 0: Generate Your llms.txt File First

Before placing the file on your site, you need to create it. A valid llms.txt file contains a site name, an optional description, and a prioritized list of your most important pages β€” your top 10–20 URLs with one-line descriptions. Do not list your entire sitemap; AI crawlers respond better to curated guidance than exhaustive lists.

Use the free llms.txt generator to build your file automatically from your site URL. It takes about 60 seconds. Once generated, save the file as llms.txt (plain text, no extension change) and follow your platform guide below to place it.

Next.js β€” App Router and Pages Router

Next.js supports two approaches: a static file in the /public directory (zero configuration) or a dynamic route handler that generates the file at request time. The dynamic approach is better for large sites where the URL list changes frequently.

  • Static: Place llms.txt in /public/llms.txt β€” it will be served at yourdomain.com/llms.txt automatically.
  • Dynamic (App Router): Create app/llms.txt/route.ts and return a Response with content-type: text/plain.
  • Dynamic (Pages Router): Create pages/api/llms.txt.ts and set res.setHeader('Content-Type', 'text/plain').

Full Next.js guide with code examples β†’

Nuxt.js

In Nuxt, place the file in the /public directory for a static approach, or use a server route for dynamic generation. The server route approach works well for Nuxt Content sites where pages are generated from markdown files.

  • Static: Add public/llms.txt β€” Nuxt serves it at the domain root automatically.
  • Dynamic: Create server/routes/llms.txt.ts and return the content with setResponseHeader(event, 'content-type', 'text/plain').

Full Nuxt.js guide with code examples β†’

Astro

Astro is the easiest framework for this task. Place your llms.txt file in the /public directory. Astro copies all files in /public to the root of your built site unchanged. No configuration needed.

For dynamically generated content (blog posts, docs), Astro also supports content collection endpoints β€” you can write a llms.txt.ts file in /src/pages/ that builds the URL list from your content collection at build time.

Full Astro guide with code examples β†’

Gatsby

In Gatsby, place the file in the /static directory. Gatsby copies everything in /static to the root of the built site. This is the simplest approach and requires no plugin or configuration change.

For dynamic generation based on your content graph, you can use the onPostBuild Gatsby Node API to generate the file during the build process.

Full Gatsby guide with code examples β†’

Remix

In Remix, create a route file at app/routes/llms[.txt].tsx that exports a loader function returning the file content as plain text. The bracket notation in the filename tells Remix to treat the dot as a literal character rather than a nested route separator.

Full Remix guide with code examples β†’

WordPress (No Plugin Required)

You do not need a plugin for WordPress. Upload your llms.txt file to the root of your WordPress installation β€” the same directory as wp-config.php β€” via your host's File Manager, FTP, or SFTP. Once uploaded, it will be accessible at yourdomain.com/llms.txt.

If you manage multiple WordPress sites or want automatic regeneration as you publish posts, a plugin-based approach is also covered in the full guide.

Full WordPress guide β†’

Webflow

Webflow allows uploading custom files to your site root through the Hosting settings panel. Go to Site Settings β†’ Hosting β†’ Publish, find the custom file upload section, and upload your llms.txt file. After the next publish, it will be accessible at your domain root.

Full Webflow guide with screenshots β†’

Shopify

Shopify does not allow arbitrary file uploads to the root domain directly. The supported approach is to add a custom route via your theme's file system. In your Shopify admin, go to Online Store β†’ Themes β†’ Edit code, and create a new template that serves plain-text content at the /llms.txt path using a URL redirect or a custom route configuration.

Full Shopify guide with theme code β†’

Framer

In Framer, you can add llms.txt via the CMS or through custom code components. The simplest approach for most Framer sites is to use the custom code settings panel to redirect /llms.txt to a hosted plain-text file, or to use Framer's file hosting if your plan supports it.

Full Framer guide β†’

Ghost, Hugo, and Other Static Sites

For Ghost, Hugo, Jekyll, Eleventy, and similar static site generators, the approach is the same: place your llms.txt file in the directory that maps to your site's root output. For most static generators this is /static, /public, or /assets depending on your configuration. The file will be copied to the root of the built site unchanged.

For Ghost specifically, place the file via SFTP in your Ghost instance's root URL directory.

Full guide for Ghost, Hugo, and static sites β†’

Squarespace and Wix

Squarespace and Wix are more restrictive than developer frameworks. Neither platform allows direct file uploads to the domain root. The approach requires using custom header injection or (for Wix) enabling developer mode to add custom routes. Both approaches are covered step by step in the full guide.

Full Squarespace and Wix guide β†’

SaaS Products β€” Structuring for AI Discovery

SaaS documentation sites have different requirements than content blogs. Your llms.txt should prioritize your API reference, getting-started guides, and feature documentation β€” not your marketing pages. AI assistants answering questions about your product should be directed to pages that explain how it works, not pages that sell it.

Full guide for SaaS products β†’

Verify Your File Is Being Read

After uploading, verify your file is accessible at yourdomain.com/llms.txt by visiting the URL directly in a browser. You should see plain text content, not an HTML page.

To confirm AI crawlers are fetching it, check your server access logs for requests to /llms.txt from these user-agent strings:

  • GPTBot/1.0 β€” ChatGPT's crawler
  • ClaudeBot/0.1 β€” Claude's crawler
  • PerplexityBot/1.0 β€” Perplexity's crawler

Crawler visits typically begin within days of the file going live. For more detail on which AI platforms read llms.txt and how to interpret your logs, see which AI crawlers read llms.txt and how to verify your file is being crawled.

Common Mistakes to Avoid

  • Wrong file location: The file must be at yourdomain.com/llms.txt β€” not a subdirectory. yourdomain.com/blog/llms.txt will not be read by crawlers.
  • HTML instead of plain text: The file must return content-type: text/plain. If your platform serves it as HTML, crawlers will receive broken content.
  • Listing your entire sitemap: Include your 10–20 most important pages. Exhaustive lists are harder for crawlers to prioritize and dilute the signal.
  • Empty or placeholder content: A file that exists but contains only boilerplate provides no value. Include real page descriptions.
  • Forgetting to verify: Always confirm the file is accessible at the root URL before assuming it's live.

Frequently Asked Questions

What should I put in my llms.txt file?

A valid llms.txt includes: a site name as an H1, an optional short description, and a list of your most important pages β€” each as a Markdown link with a one-sentence description. Aim for 10–20 pages. Focus on pages that best represent your site's purpose: key product pages, pillar content, documentation, or guides. Use the free generator to build the initial version automatically.

Does llms.txt work for subdomains?

Each domain and subdomain needs its own llms.txt file. A file at yourdomain.com/llms.txt does not cover docs.yourdomain.com. If your documentation is on a subdomain, add a separate file there pointing to the documentation pages.

How often should I update the file?

Update your llms.txt whenever your site's most important pages change significantly β€” new pillar content published, old content removed, or major restructuring. A quarterly refresh is a reasonable default for most sites. The file itself is static, so there's no performance cost to keeping it current.

How is llms.txt different from sitemap.xml?

A sitemap.xml lists all pages on your site so search engine crawlers can discover them. llms.txt lists your most important pages with human-readable descriptions so AI crawlers can prioritize them. Sitemap.xml is for discovery completeness; llms.txt is for AI-oriented prioritization. Both are worth having.

Will llms.txt affect my Google rankings?

No. Google does not read llms.txt. It has no effect on Google Search rankings in either direction. It is specifically for AI search platforms: ChatGPT, Claude, and Perplexity, which have all documented their support for the standard.

Filed under
llms.txt
how to add llms.txt
AI SEO
Next.js
WordPress
Webflow
Shopify
platform guide
2026

Ready to optimize your website for AI?

Generate your llms.txt file for free in seconds.

Try the Generator