# Next.js AI crawlers

> Serve crawler-specific robots.txt rules from Next.js, separate search discovery from model training controls, and verify the deployed response.

Canonical: https://scaplet.com/seo/nextjs/ai-crawlers

Guide Next.js Next.js · AI discovery

Serve crawler-specific robots.txt rules from Next.js, separate search discovery from model training controls, and verify the deployed response.

4 min

read

7

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

In the Next.js App Router, return separate crawler rules from `app/robots.ts` using `MetadataRoute.Robots`. OpenAI separates OAI-SearchBot search access from GPTBot training use. Google-Extended is a robots token, not a separate request user agent, and does not affect Google Search. Verify production `/robots.txt` and any CDN or firewall rules.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Fai-crawlers%20(%22Next.js%20AI%20crawlers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Fai-crawlers%20(%22Next.js%20AI%20crawlers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Fai-crawlers%20(%22Next.js%20AI%20crawlers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Fai-crawlers%20(%22Next.js%20AI%20crawlers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 4 minutes.

1. [Decide which crawler use case you mean 01](#decide-which-crawler-use-case-you-mean)
2. [Generate rules with the App Router 02](#generate-rules-with-the-app-router)
3. [Interpret crawler access and search outcomes correctly 03](#interpret-crawler-access-and-search-outcomes-correctly)

_01_Map a policy to the relevant token

## Decide which crawler use case you mean

AI bots do not all perform the same job. [OpenAI](/ai-search/chatgpt/how-it-finds-sources) distinguishes [OAI-SearchBot](/glossary/chatgpt-search), which is used for [ChatGPT](/ai-search/chatgpt) search discovery, from [GPTBot](/ai-crawlers/gptbot), which may crawl content for training. [Google-Extended](/ai-crawlers/google-extended) is a [robots.txt](/glossary/robots-txt) product token that governs certain [Gemini](/ai-search/gemini) and Vertex AI uses; Google says it has no separate HTTP request user agent and does not affect Search inclusion or ranking. A single catch-all rule can therefore change more than the use case you intend.

Token

### OAI-SearchBot

Documented purpose

OpenAI search crawling for ChatGPT search features

Decision to make

Allow if you want pages shown in ChatGPT search answers. OpenAI says opted-out sites will not be shown in those answers, though they can still appear as navigational links.

Token

### GPTBot

Documented purpose

OpenAI crawling for potential training use

Decision to make

Set a training preference independently from search availability.

Token

### Googlebot

Documented purpose

Google Search crawling, including eligibility for AI Search features

Decision to make

Keep important public pages accessible if you want them eligible for Google Search.

Token

### Google-Extended

Documented purpose

Google control token for certain Gemini and Vertex AI training and grounding uses

Decision to make

Do not treat it as a separate Google crawler or a way to opt out of Search.

Token

### ChatGPT-User

Documented purpose

User-triggered page fetches in certain ChatGPT actions

Decision to make

OpenAI says it is not used for automatic crawling, robots.txt rules may not apply because users initiate the actions, and it is not used to decide whether content appears in Search. Use OAI-SearchBot for search opt-outs.

**Google AI Overviews use Search eligibility**Google says no extra technical requirement or AI-specific optimization is required for AI Overviews or AI Mode. A page must meet normal Google Search technical requirements and be eligible to show a snippet.

_02_How it works

## Generate rules with the App Router

Next.js supports a generated robots file through the special `app/robots.ts` route. It is a special Route Handler that is cached by default unless it uses a request-time API or a dynamic config option, and it has been available since Next.js 13.3.0. In a Pages Router app, put a static `robots.txt` in `public/` instead; Next.js documents that folder for robots.txt and errors if a static file has the same name as a file in `pages/`.

app/robots.ts with independent crawler choices

```
import type { MetadataRoute } from 'next' export default function robots(): MetadataRoute.Robots { return { rules: [ { userAgent: 'OAI-SearchBot', allow: '/' }, { userAgent: 'GPTBot', disallow: '/' }, { userAgent: 'Googlebot', allow: '/' }, { userAgent: 'Google-Extended', disallow: '/' }, ], sitemap: 'https://www.example.com/sitemap.xml', } }
```

1. 01

### Write down the desired outcome

Decide separately whether to permit Search discovery, model training use, user-triggered fetches, or all crawler access. Align the choice with your content and data policy.
2. 02

### Add the special file

In an App Router project, add `app/robots.ts` and return the `MetadataRoute.Robots` shape. Use explicit user-agent groups for independent decisions and include the production sitemap URL if appropriate.
3. 03

### Deploy and inspect the response

Open `/robots.txt` on production and verify the exact groups, spelling, paths, and sitemap line. Check whether a CDN, WAF, or proxy also blocks the crawler.
4. 04

### Test representative routes

Check a public article, a commercial landing page, and a private or utility route. Confirm the rule is narrow enough to preserve the pages you want discovered.

_03_Checklist

## Interpret crawler access and search outcomes correctly

1. 01 Robots.txt is a public crawl preference, not authentication. Do not expose confidential drafts or customer data and expect a Disallow rule to protect them.
2. 02 A crawl restriction does not itself remove an already-known URL from search. If a public page should be excluded from Google, use the appropriate indexing directive and allow Googlebot to fetch it so the directive is visible.
3. 03 A robots policy does not override network controls. If logs show 403 responses, inspect the WAF, CDN, rate limits, and bot mitigation rules as well as Next.js output.
4. 04 Don't infer citation frequency from requests. Search Console measures Google's indexing and search visibility; referral analytics or a defined prompt sample measure different outcomes.
5. 05 Recheck after changing the hostname, sitemap, route structure, deployment adapter, or middleware. The framework file can be correct while a proxy serves a different response.

OpenAI recommends allowing OAI-SearchBot in robots.txt, and allowing its published IP ranges, to help a site appear in ChatGPT search results. It says it can take about 24 hours after a robots.txt update for its systems to adjust for search results. If a site allows both bots, OpenAI may use results from one crawl for both uses. Google-Extended has separate semantics. Review the latest official crawler lists before adding more user agents; names and use cases can change.

For the framework implementation, see [Next.js robots.txt](/seo/nextjs/robots-txt). For Google's token semantics, see [Google-Extended](/ai-crawlers/google-extended) and [Google AI Overviews](/ai-search/google-ai-overviews).

Sources · 7

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- nextjs.org
- openai.com
- google.com

1. 01 [Metadata Files: robots.txt | Next.js](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots) nextjs.org · checked 2026-10-24
2. 02 [Overview of OpenAI Crawlers](https://developers.openai.com/api/docs/bots) developers.openai.com · checked 2026-10-24
3. 03 [Google's common crawlers | Google Crawling Infrastructure](https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers) developers.google.com · checked 2026-10-24
4. 04 [AI features and your website | Google Search Central](https://developers.google.com/search/docs/appearance/ai-features) developers.google.com · checked 2026-10-24
5. 05 [Introduction to robots.txt | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/robots/intro) developers.google.com · checked 2026-10-24
6. 06 [Block Search indexing with noindex | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/block-indexing) developers.google.com · checked 2026-10-24
7. 07 [Public Folder | Next.js Pages Router Docs](https://nextjs.org/docs/pages/api-reference/file-conventions/public-folder) nextjs.org · checked 2026-10-24

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ How do I add AI bots to a Next.js robots.txt?

In the App Router, return separate user-agent groups from `app/robots.ts` using the `MetadataRoute.Robots` type, then inspect the deployed `/robots.txt`.

_02_ Should I block GPTBot but allow OAI-SearchBot?

Yes. OpenAI says each setting is independent: a site can allow OAI-SearchBot to appear in search results while disallowing GPTBot to indicate that crawled content should not be used for training. Verify that your deployed response contains the intended groups.

_03_ Does blocking Google-Extended remove my site from Google Search?

No. Google says Google-Extended does not affect Search inclusion or rankings; Googlebot controls Search crawling.

## Keep learning

[All platform guides](/seo)

[Learn Next.js SEO Frameworks](/seo/nextjs) [Related GPTBot OpenAI](/ai-crawlers/gptbot) [Read next Next.js robots.txt Frameworks](/seo/nextjs/robots-txt) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Next.js SEO](/seo/nextjs)

More in Next.js SEO
[Next.js 404 page](/seo/nextjs/404) [Next.js AI crawlers](/seo/nextjs/ai-crawlers) [Next.js canonical tags](/seo/nextjs/canonical-tags) [Next.js Google Analytics](/seo/nextjs/google-analytics) [Next.js image SEO](/seo/nextjs/image-seo) [Next.js lazy loading](/seo/nextjs/lazy-loading) [Next.js noindex](/seo/nextjs/noindex) [Next.js redirects](/seo/nextjs/redirects) [Next.js robots.txt](/seo/nextjs/robots-txt) [Next.js structured data](/seo/nextjs/structured-data) [Next.js title and meta description](/seo/nextjs/title-and-meta) [Next.js XML sitemap](/seo/nextjs/xml-sitemap)

Terms on this page
[ChatGPT search](/glossary/chatgpt-search) [robots.txt](/glossary/robots-txt)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
