> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# next-sitewide-noindex

> A Next.js root layout, _app or _document marks every route noindex unconditionally.

## What it flags

In a Next.js project, the App Router root layout (`app/layout.tsx`) exports `metadata` whose `robots` is a literal `{ index: false }` or a string with a `noindex` or `none` directive (each comma-separated directive is compared whole, so `max-image-preview:none` does not count), or the root layout, `pages/_app` or `pages/_document` renders `<meta name="robots">` (or `googlebot`) with such content outside any condition. Every route then tells search engines not to index it, which usually means a staging setting reached production. A `robots` value behind a ternary, `&&` or `if`, or a `metadata` object chosen at runtime, is left alone. The finding appears with `--include-contextual`, because private and internal apps noindex on purpose.

## How to review or fix

Confirm whether the deployment is meant to appear in search. If it is, set noindex only outside production, for example `robots: process.env.VERCEL_ENV === 'production' ? undefined : { index: false }`, or move it to the layouts of the routes that must stay hidden. See the [Next.js robots metadata reference](https://nextjs.org/docs/app/api-reference/functions/generate-metadata#robots).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.