How to add llms.txt to a Docusaurus site

Docusaurus does not create llms.txt. Put a file in static/ or use a community plugin. Check baseUrl: a sub-path file is not at your domain root.

Docusaurus · llms.txt · Not built in

What Docusaurus does today

Docusaurus does not generate llms.txt. None of the official plugins on docusaurus.io does it. A request for an official plugin (issue #10899) has been open since February 2025. A maintainer first replied: "I'd prefer to keep a lean core and keep this plugin in the community." In May 2025 the same maintainer wrote that the team should consider a core plugin. Nothing has shipped. On 2026-10-19, docusaurus.io itself returned 404 for /llms.txt.

The Docusaurus community resources page lists plugins that generate the file. The page is a list of community projects, so third parties maintain them.

Add llms.txt to Docusaurus

  1. Static file. Create static/llms.txt. The docs say every file in static/ is "copied into the root of the generated build folder". With the default baseUrl: '/', the file is served at /llms.txt.

    # Example Co
    
    > Project-planning software with a REST API. Start with the guides.
    
    ## Docs
    
    - [Quickstart](https://example.com/docs/quickstart): Create a project in five minutes
    
  2. Or use a community plugin. The README of docusaurus-plugin-llms says that during a production build it writes an llms.txt file linking every documentation page, plus llms-full.txt, with no configuration needed.

    npm install docusaurus-plugin-llms --save-dev
    
    module.exports = {
      plugins: ['docusaurus-plugin-llms'],
    };
    

    Its options include title, description, docsDir, includeBlog and ignoreFiles. Another community option is @signalwire/docusaurus-plugin-llms-txt, which the React Native docs use. It converts rendered pages to markdown and builds an llms.txt index that links to them. Both declare a peer dependency on Docusaurus 3. We could not verify support for Docusaurus 4, and we did not run either plugin.

  3. Build and deploy. Run npm run build. Confirm that build/llms.txt exists before you deploy.

Check that it works

After you deploy, run curl -sI https://example.com/llms.txt. Expect a 200 status and a text content type such as text/plain. The Docusaurus docs do not say what content type your host sends, so check the header. If you get your "Page Not Found" page as HTML, the file is not deployed at that path.

Paste the file into the llms.txt validator. The llms.txt exists check explains what the audit accepts.

Limits and workarounds

  • baseUrl moves the file. The docs say that with baseUrl: '/subpath/', the file /static/img/docusaurus.png "will be served at /subpath/img/docusaurus.png". The same rule moves llms.txt. A site at https://example.com/docs/ serves https://example.com/docs/llms.txt.
  • The audit does not look in sub-paths. It requests /llms.txt at your domain root and tries the docs., developers. and developer. subdomains. It will not find /docs/llms.txt. To pass, serve a copy at the domain root from your main site or host, or move the docs to one of those subdomains.
  • Plugin names collide. The community resources page links a docusaurus-plugin-llms-txt repo whose README installs a differently named npm package. A separate npm package uses the exact name docusaurus-plugin-llms-txt. Install from the README of the repo you chose, not from a name search.
  • Keep it curated. A generated file links every docs page by default. Leave out pages a new engineer would not need, for example with the ignoreFiles option.
  • Reach. llms.txt mostly helps coding agents and tools that fetch documentation, not Google or chat-assistant visibility. A docs site is still the best fit for it.

Related checks

Check it

Test your file with the llms.txt validator.

Check your own site →

Sources

Verified against these sources on