More and more people get their answers from AI engines like ChatGPT, Perplexity, and Gemini instead of clicking ten blue links. If those tools never surface your site, you’re invisible to a fast-growing slice of search. Generative Engine Optimization (GEO) is how you fix that — and llms.txt is one of its simplest, highest-leverage moves. An llms.txt file is a plain-text summary of your site, written for large language models, that helps them understand and cite you accurately. In this guide I’ll show you exactly how to write one, let the AI crawlers in, and structure content so you actually get cited by ChatGPT and Perplexity.
What is llms.txt (and why it matters)
Just like robots.txt tells search crawlers how to behave, llms.txt is an emerging convention: a single Markdown file at the root of your domain (/llms.txt) that gives language models a clean, authoritative summary of who you are and what your site offers. Web pages are noisy — nav bars, scripts, cookie banners. An llms.txt hands the model the signal without the noise, so when it answers a question about you or your topic, it has accurate facts to pull from instead of guessing.
How to write a good llms.txt
Keep it short, factual, and link-rich. Lead with an H1 (your name or brand) and a one-line summary in a blockquote, then group the important facts under H2 sections with bullet links. Here’s the shape I use:
# Your Name — What You Do
> A one-sentence summary: who you are, what you build, and the core
> technologies, written so a model can quote it verbatim.
## About
A short paragraph of plain facts. No marketing fluff — models reward clarity.
## Expertise
- Topic one — a few concrete specifics
- Topic two — frameworks and tools you use
## Selected work
- Project A — what it is: https://example.com/a
- Project B — what it is: https://example.com/b
## Links
- Website: https://www.yoursite.com
- Blog: https://www.yoursite.com/blog
- GitHub / LinkedIn / EmailRules of thumb: state facts a model can repeat (names, technologies, URLs), avoid hype it can’t verify, keep it under a few hundred lines, and update it when your story changes.
Serve it from your Next.js site
The easiest way is to drop the file in public/llms.txt — Next.js serves anything in public/ at the root, so it’s live at /llms.txt with zero config. If you’d rather generate it dynamically, use a route handler:
export function GET() {
const body = `# Your Name — What You Do
> ...
`;
return new Response(body, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
}Let the AI crawlers in (robots.txt)
None of this helps if you’re blocking the bots. Many sites disallow AI crawlers by default — if you want visibility in AI answers, explicitly allow them. The main ones to welcome: GPTBot and OAI-SearchBot (OpenAI), ClaudeBot (Anthropic), PerplexityBot, and Google-Extended (Gemini).
import type { MetadataRoute } from 'next';
export default function robots(): MetadataRoute.Robots {
const base = 'https://www.yoursite.com';
return {
rules: [
{ userAgent: '*', allow: '/', disallow: ['/api/'] },
{
userAgent: [
'GPTBot', 'OAI-SearchBot', 'ChatGPT-User',
'ClaudeBot', 'anthropic-ai',
'PerplexityBot', 'Google-Extended',
],
allow: '/',
},
],
sitemap: `${base}/sitemap.xml`,
};
}Structured data still does the heavy lifting
GEO isn’t a replacement for good technical SEO — it builds on it. The same JSON-LD that earns you rich results on Google (Person, Article, FAQPage) gives AI engines machine-readable facts to cite. Clean, semantic HTML — real headings, lists, and answers — matters even more when a model is trying to extract a single quotable sentence.
Write content AI engines want to cite
Models favor pages that answer a question directly and back it with specifics. To get cited:
- Answer up front. Put the direct answer in the first sentence or two, then explain.
- Use clear headings as questions. Match how people actually ask ("How do I…", "What is…").
- Add an FAQ section with
FAQPageschema — it’s extremely citation-friendly. - Be specific and factual. Numbers, versions, and named tools get quoted; vague claims don’t.
- Keep it fresh. Update key pages; models and their indexes prefer current information.
How to check if you’re getting cited
Test it directly: ask ChatGPT (with browsing) or Perplexity a question your content answers, plus a few "what is [your name/brand]" queries, and see whether you’re referenced. Watch your server logs or analytics for AI user-agents (GPTBot, PerplexityBot) to confirm they’re crawling you. It’s early and imperfect — but the sites that show up consistently are the ones that made themselves easy to read.
The GEO checklist
- Publish
/llms.txtwith a clear summary, facts, and links - Allow AI crawlers in
robots.ts(GPTBot, ClaudeBot, PerplexityBot, Google-Extended) - Keep JSON-LD (
Person,Article,FAQPage) and semantic HTML solid - Answer questions directly, with specifics and an FAQ
- Re-test in ChatGPT / Perplexity and watch for AI crawler hits
Related: Make your Next.js site rank (technical SEO checklist) · Build a RAG chatbot with Next.js & an LLM
Search isn’t only ten blue links anymore. Make your site effortless for a model to read, and you’ll show up in the answers people increasingly trust.