# Netlify SEO for ChatGPT, Perplexity and AI search

> Get your Netlify site into ChatGPT and AI search: robots.txt and llms.txt in the publish directory, Prerender for SPAs, snippet injection and noindex previews.

Canonical page: https://getrankroot.com/builders/netlify · Web hosting platform · checked 2026-10-21

What Netlify's own documentation says about how AI crawlers see sites built with it, and the exact settings for robots.txt, llms.txt, structured data and the sitemap.

## How Netlify delivers pages to crawlers

**Depends on what you deploy** (Depends on your project)

Netlify serves the files your build puts in the publish directory, and server-side rendered pages run on Netlify Functions. Both send crawlers real HTML. A single-page app built with React, Vue or Angular is different: Netlify's own docs say SPAs leave "the HTML body mostly empty" and that many AI agents, chat services and crawlers can't run JavaScript. For those, Netlify offers the Prerender extension, which serves rendered HTML to crawlers and agents while visitors get the normal app. Run RankRoot's audit to see which case you're in.

Why it matters: many AI crawlers don't run JavaScript. If your text only appears after scripts run, they may see an empty page.

## Make your content readable without JavaScript

1. If your site is a client-side SPA, install the [Netlify Prerender extension](https://app.netlify.com/extensions/prerender) (a Team Owner installs it), open **Extensions** > **Prerender** in the project, check **Enable prerendering**, save and redeploy. Netlify says it needs Node.js 20 or later and is free on all plans, apart from normal billing for the functions it runs.
2. If you still use Netlify's legacy prerendering setting, turn it off under **Project configuration** > **Build & deploy** > **Prerendering** first. Netlify has deprecated it in favor of the extension.
3. Connect your custom domain. Netlify says `yoursite.netlify.app` URLs keep working after you add one, so put a canonical tag pointing to your domain on every page.
4. Run the [free audit](https://getrankroot.com/#scan) on your live URL to confirm crawlers see your text without JavaScript.

## robots.txt: let AI search crawlers in

1. Put `robots.txt` in your publish directory, or in your framework's static folder so the build copies it there. Netlify says only files in the publish directory are deployed.
2. On Next.js, Astro or another framework that generates `robots.txt`, use the framework's own option instead (for Next.js, `app/robots.ts`).
3. Deploy and open `yourdomain.com/robots.txt` to confirm the live file. The [AI crawler checker](https://getrankroot.com/tools/ai-crawler-checker) tests each AI bot against it.

robots.txt that lets AI search crawlers in:

```
User-agent: OAI-SearchBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: Claude-SearchBot
Allow: /

User-agent: Claude-User
Allow: /

User-agent: *
Allow: /

Sitemap: https://yourdomain.com/sitemap.xml
```

## Add llms.txt

1. Netlify has no llms.txt setting, but it serves any file in your publish directory. Write the file with the [llms.txt generator](https://getrankroot.com/tools/llms-txt-generator) and save it as `llms.txt` next to `robots.txt`.
2. Deploy, open `yourdomain.com/llms.txt` and check it with the [llms.txt validator](https://getrankroot.com/tools/llms-txt-validator).

## Add JSON-LD and head code

1. Set titles, meta descriptions and JSON-LD in your framework's layout or head component. That works on every kind of page.
2. No access to the code? Netlify's snippet injection adds code before `</head>` or `</body>` when pages are served: **Project configuration** > **Developer settings** > **Post processing** > **Snippet Injection** > **Add Snippet**. No redeploy is needed.
3. Netlify says snippets are not injected on routes handled by a function, on SSR pages (they run on Netlify Functions) or on proxied content. Use it for static HTML only.

Example: Organization JSON-LD as a snippet injected before </head>:

```
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Your brand",
  "url": "https://yourdomain.com/",
  "description": "One sentence on what you do and who it's for."
}
</script>
```

## Sitemap

1. Netlify's docs don't describe a built-in sitemap generator. Use your framework's sitemap option (for Next.js, `app/sitemap.ts`) or a static `sitemap.xml` in the publish directory.
2. Add a `Sitemap:` line to `robots.txt` and submit the sitemap in Google Search Console and Bing Webmaster Tools.

## Common mistakes

- Deploying a React or Vite SPA without the Prerender extension and assuming AI crawlers see the content. Netlify's own docs say many AI tools can't run JavaScript.
- Adding headers in `_headers` or `netlify.toml` and expecting them on SSR or function routes. Netlify says custom headers only apply to files it serves from its own storage; functions must return their own headers.
- Treating `X-Robots-Tag: noindex` on previews as protection. Netlify adds it to Deploy Previews and older branch deploys but not to the latest deploy of each branch, and says the header is not a guarantee. Use password protection or private project visibility for previews you must keep out.
- Forgetting that `yoursite.netlify.app` keeps working after you add a custom domain. Use canonical tags so search engines credit your domain.

## FAQ

### Is my Netlify site visible to ChatGPT?

If your pages are static HTML or server-rendered, yes, as long as robots.txt allows OAI-SearchBot. A client-side SPA may look empty to AI crawlers; Netlify's Prerender extension fixes that. Run the free audit to check.

### Where does robots.txt go on Netlify?

In your publish directory (for example dist/robots.txt), or in your framework's static folder so the build copies it there. Only files in the publish directory are deployed.

### Does Netlify Prerender work for AI crawlers?

Netlify says the extension serves pre-rendered HTML to crawlers, AI agents and preview services, while visitors get your normal JavaScript app. Install it, enable it in the project and redeploy. It needs Node.js 20 or later.

### Are Netlify Deploy Previews indexed?

Netlify adds X-Robots-Tag: noindex to Deploy Previews and older branch deploys, but not to the latest deploy of each branch. It recommends password protection or private visibility to keep previews out of search.

## Sources

- [Netlify Docs: Prerendering (read 2026-10-21)](https://docs.netlify.com/build/post-processing/prerendering/)
- [Netlify blog: Prerendering for AI crawlers and modern SPAs (Dec 16, 2025) (read 2026-10-21)](https://www.netlify.com/blog/prerendering-an-old-trick-new-again/)
- [Netlify Docs: User-Agent categories (read 2026-10-21)](https://docs.netlify.com/build/user-agent-categories)
- [Netlify Docs: Build configuration overview (publish directory) (read 2026-10-21)](https://docs.netlify.com/build/configure-builds/overview/)
- [Netlify Docs: Custom headers (read 2026-10-21)](https://docs.netlify.com/manage/routing/headers/)
- [Netlify Docs: Snippet injection (read 2026-10-21)](https://docs.netlify.com/build/post-processing/snippet-injection/)
- [Netlify Docs: Deploy overview (search engine indexing) (read 2026-10-21)](https://docs.netlify.com/deploy/deploy-overview/)
- [Netlify Docs: Understand domains (read 2026-10-21)](https://docs.netlify.com/manage/domains/domains-fundamentals/understand-domains/)
- [RFC 9309: Robots Exclusion Protocol (read 2026-10-19)](https://www.rfc-editor.org/rfc/rfc9309.html)

RankRoot is not affiliated with Netlify. Check a live site: https://getrankroot.com/ or `GET https://getrankroot.com/api/audit?url=example.com`. Other builders: https://getrankroot.com/builders.md
