Go-Live Clearance

Launch accident · noindex leak

Forgot noindex in Production?

It happens to every team: <meta name="robots" content="noindex"> from staging survives into production. The site looks fine, but Google never indexes it. Weeks later you realize organic traffic is zero. Paste your URL — we catch it instantly and give you the exact fix.

How noindex leaks to production

These are the real-world patterns we see from indie teams.

  • Hardcoded noindex in layout.tsx

    The most common: robots: { index: false } committed during early development and never removed. It affects every page on the site.

  • Environment-conditional noindex that never flipped

    A NODE_ENV === 'production' check that fails because the build runs in production but runtime returns development. Or vice versa.

  • X-Robots-Tag: noindex added by middleware

    A middleware.ts that sets noindex for all non-production hosts — but the host detection logic is wrong or the middleware runs on production too.

  • CDN or platform adds noindex globally

    Cloudflare or Vercel edge rules that inject noindex for all responses. Invisible in source code, detectable only in response headers.

  • Per-page noindex from a staging template

    A blog or landing page template includes noindex. New pages inherit it automatically. Homepage is clean but subpages are invisible.

Fix the noindex leak

Each pattern has a specific fix. Start with the scan to identify which one you have.

1. Remove hardcoded noindex from metadata

// app/layout.tsx
// ❌ Find and delete this:
export const metadata = {
  robots: { index: false, follow: false },
}

// ✅ Replace with (or just omit):
export const metadata = {
  // Default is indexable — no robots directive needed
}

2. Fix conditional noindex (safe pattern)

// app/layout.tsx
export const metadata: Metadata = {
  ...(process.env.NODE_ENV === 'production'
    ? {} // indexable
    : { robots: { index: false, follow: true } }),
}

// ⚠️ Verify: after deploy, view page source and
//    search for "noindex" — it should be absent.

3. Remove X-Robots-Tag from middleware

// middleware.ts — search for and remove any line like:
// res.headers.set('X-Robots-Tag', 'noindex')

// If you need noindex only for preview deploys:
export function middleware(req: NextRequest) {
  const isPreview = req.headers.get('host')?.includes('vercel.app')
  const res = NextResponse.next()
  if (isPreview) {
    res.headers.set('X-Robots-Tag', 'noindex')
  }
  return res
}

Still check by hand

  • After fixing: view page source in production and Ctrl+F for 'noindex'
  • Check HTTP response headers for X-Robots-Tag: noindex (use curl -I or browser devtools)
  • Submit the fixed URL in Search Console → URL Inspection → Request Indexing
  • Monitor Search Console Coverage report for 'Discovered — currently not indexed' for the next 2 weeks

Related