How to write an llms.txt file models will respect
The llms.txt file is an emerging standard that tells language models which content on your site is relevant, how it's organized and how they should interpret it. Think of it as a robots.txt built for the AI era: instead of saying "what you may crawl", it says "what I am and what you should cite from me".
Where it lives
It's published at the root of your domain: https://yourdomain.com/llms.txt. It's a plain-text file in Markdown, readable by both humans and machines. Some sites also add an llms-full.txt with the full content of their key pages to make extraction easier.
What to include
- An
#heading with your brand or entity name. - A blockquote with a concise description of what you are and who you serve.
- Sections linking to your most important pages: products, documentation, FAQs and contact.
- A section with the verifiable facts you want models to cite: pricing, geographic coverage, differentiators, certifications.
A minimal example
The basic structure follows this pattern: a title with the name, a quote with the description, and then sections with lists of links. Each link carries descriptive text in brackets and the URL in parentheses, just like Markdown. Keep one idea per line and avoid filler: models reward information density, not prose.
Best practices
- Be concise and factual. Models prefer clear, verifiable statements over marketing prose.
- Link to canonical sources. One URL per fact reduces ambiguity and contradictions.
- Keep it current. A stale fact in
llms.txtis a hallucination waiting to happen. - Pair it with schema.org.
llms.txtguides; JSON-LD structures. Together they form your entity record. - Be consistent with your site. What you claim in
llms.txtmust match your website and external sources like Wikidata.
Common mistakes
The first is treating it like a marketing brochure: vague phrases, superlatives and zero data. The second is never updating it, leaving old prices or services the model will repeat. The third is contradicting your own site or your Google Business profile: inconsistency makes the model distrust you and sometimes invent. The fourth is blocking AI crawlers in robots.txt while publishing a nice llms.txt: if they can't crawl, it's useless.
How to validate your file
Before calling it done, run three checks. First, open it in the browser at yourdomain.com/llms.txt and confirm it loads as plain text with no errors. Second, verify that every link you mention exists and returns 200, because a broken link erodes credibility. Third, cross-check each fact against your website, your Google Business profile and your schema.org: if there's a single contradiction, fix it. A very useful final test is to ask ChatGPT, Claude or Perplexity directly "what do you know about [your brand]?" and compare their answer with what your llms.txt says. The gaps show you exactly which facts haven't been absorbed yet or where the model still hallucinates, and that defines your next iteration. Treat the file as living documentation, not a one-off upload.
Relationship with robots.txt and schema
The three work together. robots.txt defines what bots may crawl (including GPTBot, ClaudeBot, PerplexityBot and Google-Extended). llms.txt guides what matters and how to interpret it. schema.org (JSON-LD) structures the data so it can be extracted unambiguously. If one fails, the others lose effectiveness.
A good llms.txt doesn't guarantee citations, but a site without one leaves the AI to guess.
How we do it at Petri Heil
We generate and maintain each client's llms.txt as part of technical optimization, synced with their entity record and validated against the major generative crawlers. We review it every cycle so the data stays accurate and to add the new pages or figures we want models to cite. It's tiny in bytes but strategic: it's the first door through which a model understands who you are.