GEO & AI Search•2026-11-10•9 min read

Fixing 'Crawled / Discovered – Currently Not Indexed' in Next.js: Sitemaps, X-Robots-Tag, Streaming OG & IndexNow

When 500+ URLs sit in Google Search Console's 'Discovered – currently not indexed' bucket while 10 sample pages stall in 'Crawled – currently not indexed', the culprit is rarely robots.txt. Here is the exact diagnostic teardown of crawl-budget quality gates, non-HTML sitemap pollution, and streaming OpenGraph metadata.

L
LaunchIndex Editorial
GEO & Crawler Architecture
robots.txtGoogle Search ConsoleNext.jsIndexNowOpenGraphTechnical SEOGEOFirebase App Hosting
Fixing 'Crawled / Discovered – Currently Not Indexed' in Next.js: Sitemaps, X-Robots-Tag, Streaming OG & IndexNow

The Mystery of 521 Discovered Pages and Stalled Indexing

Every developer directory and SaaS founder eventually hits the same sobering Google Search Console (GSC) graph: your sitemap.xml validates cleanly, your pages load in under 150ms, yet GSC shows 521 pages stuck in "Discovered – currently not indexed" and 10 sample pages flagged as "Crawled – currently not indexed."

Even worse: when you run an OpenGraph meta checker against your own production URL, the scraper reports missing og:image tags—even though you configured export const metadata in Next.js layout.tsx.

When debugging this, it is easy to blame robots.txt. In fact, we initially hypothesized that listing explicit allow: ["/", "/llms.txt", "/api/mcp"] rules in robots.ts was blocking Googlebot from /blog/* and /tool/*. That hypothesis was wrong: under RFC 9309, as long as Allow: / is present in the group, all public paths not matched by a more specific Disallow rule remain crawlable.

The real reason a young domain stalls at 500+ unindexed URLs is Google's initial quality sampling and crawl-budget allocation. When Googlebot crawls a sample batch of 10–20 pages on a low-authority domain and encounters non-HTML files in sitemap.xml, thin utility routes, or unparsed Markdown syntax, it deprioritizes the rest of the sitemap queue.


Root Cause #1: Non-HTML Endpoints in sitemap.xml & Missing X-Robots-Tag

In modern AI-ready Next.js apps, developers often expose machine-readable endpoints like /llms.txt, /llms-full.txt, /api/mcp, and /api/geo/feed.json—and proudly add them to src/app/sitemap.ts alongside /privacy and /terms.

Why This Hurts Crawl Quality

  1. sitemap.xml must only list canonical, indexable HTML pages. When Googlebot fetches a JSON or plain-text feed listed in your sitemap, or crawls /sitemap.xml itself without a noindex HTTP header, GSC logs those URLs under "Crawled – currently not indexed", dragging down your domain's indexation ratio.
  2. Boilerplate legal pages dilute crawl budget. Including /terms and /privacy in sitemap.xml wastes initial sample crawls on zero-search-value legal text.

The Production Fix

Remove all non-HTML endpoints and legal boilerplate from src/app/sitemap.ts, and attach X-Robots-Tag: noindex, follow headers to XML/JSON routes in next.config.mjs:

// next.config.mjs — Prevent XML sitemaps and JSON/MCP feeds from polluting HTML indexation
async headers() {
  return [
    {
      source: "/sitemap.xml",
      headers: [{ key: "X-Robots-Tag", value: "noindex, follow" }],
    },
    {
      source: "/api/mcp",
      headers: [{ key: "X-Robots-Tag", value: "noindex, follow" }],
    },
  ];
}

Meanwhile, keep src/app/robots.ts simple and unambiguous—allow "/" globally and explicitly disallow only private routes so you never accidentally drop "/" when editing AI bot arrays:

// Clean src/app/robots.ts
import { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
  const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://launchindex.io";
  const privateDisallowed = [
    "/api/webhooks/",
    "/api/checkout",
    "/api/admin/",
    "/api/chat/",
    "/api/revalidate",
    "/admin/",
    "/live",
    "/claim/*?token=*",
  ];

  return {
    rules: [
      { userAgent: "*", allow: "/", disallow: privateDisallowed },
    ],
    sitemap: `${baseUrl}/sitemap.xml`,
    host: baseUrl,
  };
}
Diagnostic Signal Polluted Sitemap + Raw Markdown Clean HTML Sitemap + X-Robots-Tag
/sitemap.xml in GSC Flagged as Crawled – not indexed Excluded cleanly via X-Robots-Tag: noindex
Crawl Sample Quality Diluted by JSON feeds & thin legal pages Concentrated on high-value HTML guides & tools
robots.ts Maintenance Prone to accidental path omissions Single allow: "/" + explicit private disallow list

Root Cause #2: Unrendered Markdown & Thin Client-Only Utility Pages

When we inspected the exact 10 URLs flagged in Google Search Console's "Crawled – currently not indexed" report, two content defects stood out immediately:

  1. Raw Markdown Tokens in SSR HTML: Tool overview fields stored with ### headings and **bold** syntax were being rendered inside plain <p> tags instead of parsed semantic <h3>, <ul>, and <strong> HTML elements. To Google's quality classifier, unrendered Markdown tokens look like unfinished scraper output.
  2. Thin Interactive Utility Pages: Client-side tools (like an OpenGraph Meta Checker) often render only an input box and button on initial SSR load (<70 words of text). Adding a comprehensive, server-rendered reference guide and FAQ below the interactive tool gives crawlers substantive semantic text on the initial HTTP response.

Root Cause #3: Why og:image Disappears on Cloud Run / App Hosting

The third crawler pitfall hides inside Next.js Streaming Metadata.

When deploying Next.js 15/16 to serverless containers (Firebase App Hosting, Cloud Run, or Vercel), Next.js may stream metadata tags asynchronously for unrecognized user agents or fail if metadataBase encounters an unexpected proxy host header.

Social scrapers (Slackbot, WhatsApp, custom Meta Checkers, and lightweight curl inspections) often inspect only the initial <head> block and do not execute streaming scripts injected later in the document.

The Bulletproof Fix: Hardcoded Fallback Tags in <head>

Keep your dynamic route-level generateMetadata for blog posts and tools, but also render explicit fallback <meta> tags directly inside <head> in app/layout.tsx:

<head>
  <meta property="og:image" content="https://launchindex.io/brand/launchindex-card-v4.png" />
  <meta property="og:image:width" content="1200" />
  <meta property="og:image:height" content="630" />
  <meta property="og:image:alt" content="LaunchIndex · The Open-Source & Developer Tool Radar" />
  <meta property="og:image:type" content="image/png" />
  <meta name="twitter:card" content="summary_large_image" />
  <meta name="twitter:image" content="https://launchindex.io/brand/launchindex-card-v4.png" />
</head>

Verify your fix immediately by running:

curl -s https://yourdomain.com | grep -i "og:image"

If grep returns nothing from a bare curl request, lightweight scrapers cannot see your social card.


Step 4: Trigger Immediate Bing / AI Discovery with IndexNow

While Google relies on its own crawl queue and Search Console validation, IndexNow pushes fresh URLs straight into Bing, ChatGPT Search (which relies heavily on Bing's index), Yandex, and Seznam within minutes.

  1. Expose your verification key at /indexnow.txt via a plain-text Route Handler.
  2. Run a batch POST script right after every deployment:
const payload = {
  host: "launchindex.io",
  key: process.env.INDEXNOW_KEY,
  keyLocation: "https://launchindex.io/indexnow.txt",
  urlList: [
    "https://launchindex.io/",
    "https://launchindex.io/blog",
    "https://launchindex.io/blog/robots-txt-indexnow-ai-crawler-indexing-fix-2026"
  ],
};

await fetch("https://api.indexnow.org/indexnow", {
  method: "POST",
  headers: { "Content-Type": "application/json; charset=utf-8" },
  body: JSON.stringify(payload),
});

Remember that Google does not participate in IndexNow. For Google, the only sustainable path out of "Discovered – currently not indexed" on a new domain is pruning low-value/non-HTML URLs from sitemap.xml, ensuring every HTML page renders rich semantic markup on the first byte, and earning real organic backlinks.


Pre-Deploy Crawler Checklist

Before pushing any Next.js SEO/GEO release to production, verify these three assertions:

  • curl -sI https://yourdomain.com/sitemap.xml returns X-Robots-Tag: noindex, follow and contains only canonical HTML URLs.
  • curl -s https://yourdomain.com contains raw og:image and application/ld+json inside <head>.
  • Dynamic Markdown fields are parsed into semantic HTML (<h2>, <p>, <ul>) rather than raw ### tokens.
Launch on LaunchIndex

Are you building a developer tool or micro-SaaS?

Submit your software to the weekly cohort. Get indexed in our 3D Spaceport Terminal, unlock permanent dofollow backlink equity, and feed directly into our machine-readable /llms.txt corpus for ChatGPT and Perplexity.