llms.txt in Ghost
Ghost is a CMS, not a static host, so serving a root llms.txt takes either a built-in option or a routing workaround.
Last updated:
The Ghost constraint
Unlike a static-site generator, Ghost does not expose a folder that maps to your domain root, so
you cannot simply drop a file next to your posts. There are three realistic routes to a working
/llms.txt, from easiest to most manual.
Method 1: the native toggle
Recent versions of Ghost added a built-in option to publish an AI/LLM discovery file. In
Settings (SEO or the meta/structured-data area, depending on version), look for an
option such as enable structured data for LLMs and AI search engines. When enabled,
Ghost generates and serves /llms.txt (and often /llms-full.txt)
automatically from your published content.
Method 2: self-hosted content/public
On a self-hosted Ghost install, files placed in content/public/ are served from the site
root. This is the only true filesystem drop-in and gives you a hand-authored file:
# on your Ghost server
mkdir -p content/public
cp llms.txt content/public/llms.txt
# served at https://yourdomain.com/llms.txt (restart Ghost if needed)
Method 3: routes.yaml or a redirect
On Ghost(Pro), where you cannot reach the filesystem, you have two options:
- routes.yaml: define a route that renders a plain-text template. Upload a modified
routes.yamlin Settings, Labs:
then add anroutes: /llms.txt/: template: llms content_type: text/plainllms.hbstemplate to your theme containing the file body. - Redirect: host the file elsewhere (a gist, a bucket, or another static site) and
add a redirect in Settings, Labs, Redirects (
redirects.json) from/llms.txtto that URL. Simplest, but the file then lives off-domain.
Verifying the setup
curl -sI https://yourdomain.com/llms.txt | grep -i content-type
# expect: content-type: text/plain On WordPress instead? See the WordPress guide. To get the file contents right, use the how-to guide and the generator.