How to Implement llms.txt and JSON-LD Schema for AI Search Citations (Complete Tutorial)
Give AI crawlers a clean Markdown map of your website and machine-readable JSON-LD entity graphs. Includes production-ready templates you can deploy today.

Step 1: Authoring a Clean /llms.txt Manifest
While `robots.txt` tells crawlers what they may access and `sitemap.xml` lists every URL, `/llms.txt` gives language models a concise, token-efficient Markdown overview of your site's purpose and highest-value routes.
# Acme Dev Docs (https://example.com)
> Practical engineering tutorials, API references, and open-source benchmarks.
## Core Guides
- [MCP Server Tutorial](https://example.com/blog/mcp-server/): Build TypeScript & Python MCP servers.
- [Hybrid RAG Guide](https://example.com/blog/hybrid-rag/): BM25, dense vectors, and RRF reranking.
## Reference
- [XML Sitemap](https://example.com/sitemap.xml): Complete index of canonical URLs.Step 2: Combining Article and FAQPage JSON-LD
JSON-LD lets Google and AI retrieval pipelines extract headlines, publication dates, author roles, and Q&A pairs without guessing from CSS classes. Always keep schema text 100% consistent with visible page content.
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Where should llms.txt be hosted?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Host llms.txt at the root of your domain (https://yourdomain.com/llms.txt) inside your static public directory."
}
}
]
}Frequently Asked Questions
Does llms.txt replace sitemap.xml or robots.txt?
No. Keep robots.txt for crawl permissions and sitemap.xml for full URL discovery. llms.txt complements them as a curated, LLM-friendly summary.
Should I allow GPTBot, ClaudeBot, and PerplexityBot in robots.txt?
If your goal is GEO visibility and AI search citations, yes—ensure your robots.txt does not accidentally block OAI-SearchBot, PerplexityBot, or Google-Extended.