GEO for Next.js
Ship AI-readable Next.js apps with zero hydration blind spots. Configure public/llms.txt, app/robots.ts, Server Component JSON-LD in app/layout.tsx, and test localhost:3000 locally.
Audit Your Production Next.js Site
Enter your deployed Next.js URL to check raw SSR word count, AI crawler rules, llms.txt, and JSON-LD:
See a sample report — n8n.io scored 66/100 (Basic), 8/11 dimensions above 60%.
1. Serve public/llms.txt & app/robots.ts
Drop public/llms.txt at the project root so Next.js serves it statically at /llms.txt, and use typed app/robots.ts to declare AI crawler access:
// app/robots.ts
import type { MetadataRoute } from 'next';
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{ userAgent: '*', allow: '/' },
{ userAgent: 'GPTBot', allow: '/' },
{ userAgent: 'OAI-SearchBot', allow: '/' },
{ userAgent: 'ClaudeBot', allow: '/' },
{ userAgent: 'PerplexityBot', allow: '/' },
{ userAgent: 'Google-Extended', allow: '/' },
],
sitemap: 'https://yourapp.com/sitemap.xml',
};
} 2. Eliminate SSR vs CSR Blind Spots & Emit JSON-LD in app/layout.tsx
AI crawlers such as GPTBot, ClaudeBot, and PerplexityBot frequently parse initial SSR HTML without running client JavaScript. Keep marketing copy, docs, pricing, and structured data inside React Server Components rather than 'use client' fetch hooks:
// app/layout.tsx (Server Component)
const orgSchema = {
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'Your App',
url: 'https://yourapp.com',
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(orgSchema) }}
/>
</head>
<body>{children}</body>
</html>
);
} 3. Audit localhost:3000 in CI, Agents & Browser
- ✓CLI in dev or CI: Run
npx geoscore http://localhost:3000 --jsonto catch SSR/schema regressions before shipping. - ✓MCP Server: Connect
geoscore-mcpto Claude Desktop, Cursor, or Antigravity to runaudit_urlandgenerate_fixesinside your coding loop. - ✓Chrome Extension: Inspect live rendered DOM vs raw SSR HTML directly on
localhost:3000or staging auth-gated routes.
Monitor Production Deployments Automatically with Pro
Track weekly GEO scores across up to 5 domains, spot accidental robots.txt or SSR regressions after deploys, and export PDF reports for stakeholders.
Next.js GEO FAQ
Where do I put llms.txt in a Next.js project?
Place a static llms.txt file inside your public/ directory (public/llms.txt) so Next.js serves it at /llms.txt automatically in both App Router and Pages Router. If your directory changes dynamically, you can also serve it from an App Router route handler at app/llms.txt/route.ts.
How do I configure AI crawlers with app/robots.ts in Next.js App Router?
Export a default function returning MetadataRoute.Robots from app/robots.ts with explicit rules allowing GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot, and Google-Extended, along with your sitemap URL.
Why do client-rendered Next.js pages score poorly with AI crawlers?
Many AI crawlers inspect the raw initial HTML response without waiting for client-side JavaScript hydration. Pages marked with 'use client' that fetch primary copy inside useEffect ship empty shells to crawlers. Render core copy and JSON-LD in Server Components or SSR/SSG.
Can I audit localhost:3000 before deploying my Next.js app?
Yes. Run npx geoscore http://localhost:3000 in your terminal, connect geoscore-mcp to your AI coding agent, or use the GeoScore Chrome Extension to inspect both raw SSR HTML and the live hydrated DOM on localhost:3000.