Skip to main content
Reggie Pangilinan
HomeBlogAbout
GitHubLinkedIn

© 2026 reggiepangilinan.com All rights reserved.

GitHubLinkedIn
Generative Engine Optimization (GEO) in Next.js 16…
←Back to Blog

Generative Engine Optimization (GEO) in Next.js 16: llms.txt, RSS, JSON-LD & Crawler Access

What GEO actually means, how AI search engines differ from classic Google Search, and the six upgrades I shipped so AI assistants can discover and cite my site.

December 2, 2026·Reggie Pangilinan·4 min read
Generative Engine Optimization (GEO) in Next.js 16: llms.txt, RSS, JSON-LD & Crawler Access

More and more developers aren't just typing questions into Google—they're asking ChatGPT Search, Perplexity, Claude, and Google AI Overviews directly. 🤖

Traditional SEO gets your pages ranked in blue links. GEO (Generative Engine Optimization) makes sure AI crawlers and answer engines can cleanly read your site, verify _who_ wrote it, and cite your exact URLs accurately.

After auditing reggiepangilinan.com specifically through the eyes of AI crawlers, I shipped six straightforward GEO upgrades. Before diving into the code, here is a quick primer on what AI crawlers actually look for.


🧠 Quick Primer: What Is GEO and How Do AI Crawlers See Your Site?

AI answer engines work differently from classic browser users in a few important ways:

  • Most AI crawlers don't run JavaScript: Bots like GPTBot, OAI-SearchBot, ClaudeBot, and PerplexityBot fetch raw HTML. If your page requires client-side JS just to render text—or hides the page via CSS until a script runs—you're making their job harder.

  • They love clean machine-readable indexes (/llms.txt & /rss.xml): While /sitemap.xml lists raw URLs, /llms.txt gives LLMs a concise Markdown directory of who you are and what every article is about, and /rss.xml lets aggregators and AI pipelines spot new posts fast.

  • They rely on Knowledge Graph entities (JSON-LD): Structured Person, WebSite, and BlogPosting schemas connect your name, role, GitHub, LinkedIn, and articles into one verified entity so AI answers attribute your writing to _you_ instead of hallucinating or mixing up authors.

  • : Just like Googlebot, reputable AI bots respect rules before crawling or citing a site.

Keep Reading

Related Posts

December 3, 2026

Adding AI-Powered Blog Search with Google Gemini in Next.js

How we added an intelligent, Gemini-powered search bar to a Next.js + Contentful blog—covering AI basics for non-specialists, why hybrid search beat Google Search Grounding and Vertex AI Search, real-world free-tier traffic estimates, and built-in cost guardrails.

Next.jsTypeScript
December 2, 2026

Four Silent Sitemap & SEO Bugs I Found Auditing My Next.js 16 Blog

What sitemaps, robots.txt, and canonical URLs actually do for search indexing—plus four silent SEO bugs I found and fixed auditing my Next.js 16 + Contentful blog.

Next.jsSEO
December 2, 2026

Client-Side QR Code Sharing and Smart Open Graph Cards in Next.js

How I built PostShareBar (copy link, Web Share API, and downloadable client-side QR codes) alongside word-boundary SEO truncation and auto-cropped 1200×630 Open Graph cards.

Next.jsSEO
Topics
Next.jsSEOGEOAIContentfulTypeScript

Share this article

Found this helpful? Copy the link or scan the QR code to share it.

←All blog posts
They check
robots.txt
explicitly
robots.txt
GEO Stack — reggiepangilinan.com
GEO Stack — reggiepangilinan.com

📄 1. Added a Dynamic /llms.txt Endpoint

Why: /llms.txt is the emerging standard for giving AI agents and LLM search engines a zero-noise Markdown map of your site right at the root (https://reggiepangilinan.com/llms.txt). Previously, requesting it returned a 404.

How: I created src/app/llms.txt/route.ts with export const dynamic = 'force-dynamic' and a 5-minute edge cache (s-maxage=300). It pulls all published posts live from Contentful (getBlogPosts(1000, 0)) and outputs clean Markdown (text/markdown; charset=utf-8) covering my bio, core pages, feeds, GitHub/LinkedIn profiles, and every published post with its URL, publish date, tags, and excerpt—updating automatically every time a new post goes live.


📡 2. Added a Live RSS 2.0 Feed (/rss.xml)

Why: AI discovery pipelines, Perplexity, and developer feed readers poll RSS feeds frequently to pick up fresh technical writing without crawling entire sites.

How: I added src/app/rss.xml/route.ts (force-dynamic, 5-minute edge cache) generating valid RSS 2.0 XML with <atom:link rel="self">, publish dates, excerpts, and <category> tags for every post—and advertised it site-wide via metadata.alternates.types in src/app/layout.tsx so crawlers discover <link rel="alternate" type="application/rss+xml" href="/rss.xml" /> automatically.


🕸️ 3. Wired Up Complete Person, WebSite, and BlogPosting JSON-LD

Why: During the GEO audit, I realized generatePersonJsonLd() already existed in my codebase—but was never rendered anywhere, there was no WebSite schema, and BlogPosting hardcoded dateModified to publishDate instead of using Contentful's sys.updatedAt!

How:

  • In src/lib/seo.ts, I enriched generatePersonJsonLd() with image, sameAs (GitHub + LinkedIn), and knowsAbout, added generateWebSiteJsonLd(), and upgraded generateBlogPostJsonLd() with mainEntityOfPage, keywords, author.sameAs, and real modifiedDate.

  • In src/app/layout.tsx, I injected both Person and WebSite <script type="application/ld+json"> tags site-wide.

  • In src/app/blog/[slug]/page.tsx, I passed modifiedDate: post.sys?.updatedAt || publishDate and tags into generateBlogPostJsonLd().


👁️ 4. Fixed Non-JS Crawler Visibility (data-theme="dark")

Why: To prevent a white flash before dark mode hydrates, src/app/globals.css had html:not([data-theme]) { visibility: hidden }. Because <html> didn't have data-theme in the server-rendered HTML, any CSS-aware crawler that doesn't execute JavaScript saw the entire page marked visibility: hidden!

How: Since dark mode is already the default, adding data-theme="dark" directly on <html lang="en" data-theme="dark" suppressHydrationWarning> in src/app/layout.tsx guarantees non-JS crawlers immediately see visibility: visible, while returning light-mode visitors still switch before first paint via the inline <head> script.


🤖 5. Explicit AI Crawler Permissions in robots.txt

Why: Even though User-agent: * allows crawlers by default, explicitly listing major AI search and citation bots makes your intent crystal clear to both crawlers and GEO auditors.

How: Updated src/app/robots.txt/route.ts to include explicit Allow: / blocks (still disallowing /dev-info, /debug, /api) for OAI-SearchBot, GPTBot, ChatGPT-User, ClaudeBot, PerplexityBot, Google-Extended, and Applebot-Extended, alongside pointers to /sitemap.xml, /llms.txt, and /rss.xml.


🧹 6. Cleaned Up a Leftover Placeholder Meta Tag

Why: src/app/layout.tsx was emitting a literal <meta name="google-site-verification" content="your-google-verification-code" /> placeholder on every page.

How: Changed it to only emit verification.google when process.env.GOOGLE_SITE_VERIFICATION is actually configured—keeping the <head> clean.


✨ Wrapping Up

Good GEO doesn't require gimmicks or keyword stuffing—it's just clean engineering: server-rendered HTML, accurate JSON-LD entities, live /llms.txt and /rss.xml feeds, and explicit crawler permissions.

You can inspect all six changes in src/app/llms.txt/route.ts, src/app/rss.xml/route.ts, src/lib/seo.ts, src/app/layout.tsx, and src/app/robots.txt/route.ts on GitHub.