Skip to main content

Automatically Generate llms.txt to Improve AI SEO

llms.txt is designed to work alongside current web standards like sitemaps.xml and robots.txt, complementing them by providing context for allowed content and an overview for AI.

By providing relevant and structured information, llms.txt helps AI perform better during inference time when users seek support. This leads to better, more accurate, and more helpful answers and assistance, directly impacting user satisfaction and the utility of AI applications.

The TanaFlows theme automatically generates llms.txt for you - you don’t need to create this file. However, you need to enable this feature in Ghost Admin through the Labs route.


How to Enable Automatic llms.txt Generation

  1. Go to Settings > Labs > Routes

  2. Download the routes.yaml file

  3. Open with Notepad and add the following line at the beginning of the file:

    routes:
    /llms.txt/:
    template: llms
    content_type: text/plain
  4. Save the file and upload the modified routes.yaml back to Labs.

File default routes.yaml of ghost has the following content:

routes.yaml
routes:
collections:
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/

File routes.yaml after you add the line above has the following content:

routes.yaml
routes:
/llms.txt/:
template: llms
content_type: text/plain
collections:
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/

Controlling Pages Added to llms.txt

By default, the following posts and pages will automatically be displayed in llms.txt:

  • Posts marked as Featured
  • Pages marked as Featured
  • 10 most recently published posts
  • Website owner information automatically pulled from your profile

When you publish a new post, llms.txt will automatically update for you.

Enable Featured to add to llms.txt file
Enable Featured on the page you want to add to the llms.txt file

How to Check and Validate llms.txt

After uploading your modified route.yaml, you need to check and validate this file.

In your browser, add llms.txt to your URL. For example: https://your-domain.com/llms.txt then press Enter.

If the file is created successfully, you will see its contents.

Additionally, you can use the online tool below to check:

Simply paste your site URL in the Enter Domain field to check if your site has llms.txt and whether the file has the correct structure.

ghostFam's `llms.txt` file
ghostFam’s llms.txt file at https://ghostfam.com/en/llms.txt