Guide

Adding llms.txt to a Drupal site

Drupal gives you two clean paths to an llms.txt: a contributed module that generates it from your content, or a static file in the docroot since you control the server.

Option 1 — a contributed module (auto-generated)

Modules in the Drupal ecosystem expose a /llms.txt endpoint built from your published content — for example a plain-text summary organized by content type. Install with Composer and enable it:

composer require drupal/llms_txt
drush en llms_txt

Then configure which content types and fields feed the file. Good for large or frequently-changing sites.

Option 2 — a static file in the docroot

Because Drupal is self-hosted, you can place a hand-written llms.txt in your site's web root, next to index.php (e.g. web/llms.txt or docroot/llms.txt). Drupal's .htaccess serves existing static files directly, so it's available at /llms.txt immediately. Best when you want full control over the content.

Keep it curated

Whichever route you choose, link your highest-value pages, not every node. A short, focused file beats an exhaustive dump.

Validate

Paste your domain into the validator to confirm the file is reachable and every link resolves.

Keep reading

Validate your llms.txt →