Skip to content

feat(seo): noindex LLM text endpoints - #92

Merged
nibzard merged 1 commit into
mainfrom
seo/noindex-llm-endpoints
Jul 30, 2026
Merged

feat(seo): noindex LLM text endpoints#92
nibzard merged 1 commit into
mainfrom
seo/noindex-llm-endpoints

Conversation

@nibzard

@nibzard nibzard commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

The plain-text mirrors of the docs are ranking against the HTML pages they duplicate. Search Console shows /llms-full.txt with 37,527 impressions (18% of the site's total) at average position 17.9 and a 0.03% CTR: a raw text dump shown to human searchers, dragging the site-wide CTR baseline down.

Change

X-Robots-Tag: noindex on every alternate-format endpoint, using whichever mechanism owns the response:

Endpoint Mechanism
/llms.txt and per-section */llms.txt headers() in next.config.mjs (static files in public/)
/AGENTS.md headers() in next.config.mjs
/llms-full.txt route handler (app/llms-full.txt/route.ts)
/llms.mdx/* and every .md-suffixed docs URL route handler (app/llms.mdx/[[...slug]]/route.ts), which middleware rewrites .md URLs into

Crawling is untouched: robots.txt still allows everything and no Disallow was added, so agents keep fetching these exactly as before. Only indexing is suppressed.

/AGENTS.md gets its header from next.config.mjs rather than from its route handler on purpose. Middleware rewrites / to /AGENTS.md for markdown and programmatic clients, and header matching happens on the requested path, so the homepage keeps its own headers instead of inheriting noindex. No HTML page is noindexed.

Test evidence

TDD: the two new header assertions in tests/e2e/llm-endpoints.test.ts failed first (x-robots-tag was null), then passed after the implementation. A third test pins the homepage as indexable even when it negotiates markdown.

  • bun test tests/e2e/llm-endpoints.test.ts: 14 pass, 0 fail
  • bun test (full suite): 230 pass, 0 fail
  • bun run lint clean, bun run typecheck clean

Manual probe against next dev with the generated llms.txt files present:

/llms.txt                             200 | noindex
/overview/llms.txt                    200 | noindex
/overview/sessions-api/llms.txt       200 | noindex
/llms-full.txt                        200 | noindex
/AGENTS.md                            200 | noindex
/llms.mdx/overview/steel-cli          200 | noindex
/overview/sessions-api/quickstart.md  200 | noindex
/overview/sessions-api/quickstart     200 | none
/robots.txt                           200 | none
/sitemap.xml                          200 | none
/  (also with accept: text/markdown)  200 | none

The plain-text mirrors of the docs were competing with the HTML pages they
duplicate: /llms-full.txt alone earned 37,527 Search impressions (18% of the
site's total) at position 17.9 with a 0.03% CTR, which drags the whole site's
CTR baseline down and puts a raw text dump in front of human searchers.

Send X-Robots-Tag: noindex on every alternate-format endpoint: /llms.txt and
its per-section copies plus /AGENTS.md via headers() in next.config.mjs, and
/llms-full.txt plus the /llms.mdx route (which also backs every .md-suffixed
docs URL) from the route handlers that build those responses. Crawling is
untouched: robots.txt still allows everything, so agents fetch these as before
and only indexing is suppressed.

Header matching happens on the requested path, so the homepage keeps its own
headers when middleware rewrites it to /AGENTS.md for markdown clients. No HTML
page gets noindex.
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 30, 2026 12:58pm

Request Review

@nibzard
nibzard merged commit 248aa75 into main Jul 30, 2026
3 checks passed
@nibzard
nibzard deleted the seo/noindex-llm-endpoints branch July 30, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant