ShipworkSite inspection
Checks

Crawlability

PaginationAre paginated pages set up right?Internal searchIs site search eating crawl budget?URL parametersAre parameters creating duplicates?Log analyserWhat does Googlebot actually crawl?Robots builderNeed a robots.txt file?Soft 404sAre pages “not found” but returning 200?JavaScriptCan crawlers see it without running JS?FreshnessIs my site quietly going stale?Robots.txtDoes robots.txt say what I think?

Indexing

Sitemap lastmodAre my sitemap dates valid?SitemapIs my sitemap actually fetchable?IndexingIs Google allowed to index my pages?CanonicalsIs Google indexing the wrong URL?Index signalsDo sitemap and index signals agree?Sitemap generatorNeed a sitemap.xml for my site?Bulk URL statusWhere does each of these URLs really land?Redirect builderNeed the redirect rules?RedirectsAre my URLs answering directly, over HTTPS?

On-page

Keyword ideasWhat are people searching for?SERP previewHow does my page look in Google?Content qualityAre your pages too thin or too alike?Image weightAre images slowing the page?CannibalizationAre pages competing with each other?On-page checkDoes the page use its target phrase?ImagesAre my images accessible and loading?Meta tag builderWhat should my title and share tags say?DuplicatesDo my pages compete for one query?

Links

Orphan pagesWhich pages can no link reach?Link graphHow deep do your pages sit?Anchor textDo links say what they point at?Outbound linksAre external links still alive?Broken linksAre internal links sending visitors nowhere?

Structured data

Rich resultsIs my markup eligible for a rich result?Structured dataIs my product schema valid?Schema coverageDo my key pages carry structured data?Social previewHow does my page look when shared?Schema vs pageDoes markup match the page price?Schema builderNeed valid JSON-LD?

International

Hreflang sitemapDo page and sitemap hreflang agree?HreflangDo my language versions link back?Hreflang builderNeed the hreflang tags?Page DoctorWhy is this page not doing well?Redirect planMy site has dead links — what redirects do I write?Sitemap diffIs anything missing from my sitemap?Robots simulatorWhat does my robots.txt actually block?Can Googlebot?Can Googlebot fetch this URL?
Every error, explainedGuides
Pricing Learn Error guides Run free audit

+1 free check

Welcome to Shipwork

Sign in free and your next check this month is on us.

Continue with GoogleContinue with email

We email you a 6-digit code. No password.

No card needed. Reports and watches follow you to any device.

How to serve llms.txt from a Next.js site

A Next.js site can serve llms.txt as a static file or generate it at build or request time. Use a static file if the list rarely changes, and a route handler if it should follow your CMS or docs.

Published

Option 1: a static file

Put llms.txt in the public/ folder. Next.js serves everything in public/ from the site root, so it answers at /llms.txt with no code. Build the Markdown with the llms.txt generator.

Option 2: an App Router route handler

To build the file from your content, create app/llms.txt/route.ts:

import { getGuides } from '@/lib/content';

export const dynamic = 'force-static';

export async function GET() {
  const guides = await getGuides();
  const body = [
    '# Example Docs',
    '',
    '> Documentation for the Example API.',
    '',
    '## Guides',
    ...guides.map(g => `- [${g.title}](https://example.test${g.path}): ${g.summary}`)
  ].join('\n');
  return new Response(body, {
    headers: { 'content-type': 'text/plain; charset=utf-8' }
  });
}

force-static renders it once at build time; remove it to rebuild on each request. Do not also keep a public/llms.txt: a file in public/ and a route at the same path conflict.

Check it

  • Request /llms.txt and confirm a 200 with a text/plain content type.
  • Check middleware does not redirect it, for example to a locale prefix.
  • Run the AI crawler check to confirm robots.txt lets AI agents read it.
Find out if this is happening to you

Shipwork checks whether /llms.txt exists and is served as text, alongside AI crawler access in robots.txt. Free, no account, no signup. Paste your store address.

Generate an llms.txt

Questions

Where do I put llms.txt in Next.js?
In public/llms.txt for a static file, or app/llms.txt/route.ts to generate it.
Should llms.txt be text/plain?
Plain text or Markdown both work for readers; text/plain with UTF-8 is the safe default.
Does it work with the Pages Router?
Yes. The public/ folder works the same way; for generated content use an API route with a rewrite from /llms.txt.

Keep reading