How to make prerender-node serve AI crawlers: check the list, add the missing bots, test it
Your prerender middleware renders pages only for user agents on its crawler list. If an AI crawler isn't on that list, the middleware doesn't prerender for it. Here's the fix in short: open node_modules/prerender-node/index.js, look for the crawler names you care about, add the missing ones with .addUserAgents(), and test with curl using the crawler's full user-agent string.
The annoying part is that nothing errors. So check what's actually on the list before you assume a crawler is covered.
How prerender-node decides who gets rendered HTML
The README puts it plainly: the middleware checks if the request is from a crawler by checking the user agent string. In the source, that check lowercases both sides and looks for each list entry inside the incoming user agent.
return userAgent.toLowerCase().indexOf(crawlerUserAgent.toLowerCase()) !== -1;So it's a case-insensitive substring match. An entry like 'GPTBot' matches any user agent that contains gptbot anywhere in it. The catch: the entry is matched against the full user-agent header the crawler sends, not against the bot's name. The name Claude-SearchBot doesn't contain claudebot, so a 'ClaudeBot' entry covers that crawler only if its actual header has claudebot somewhere else in it. Check the header in your logs instead of assuming.
The user agent isn't the only gate. The source also returns early in a few cases, and these are the ones worth checking when a bot still gets the unrendered page:
- Only GET and HEAD requests are prerendered. Any other method skips it.
- A request that already carries an x-prerender header is skipped.
- Requests for files with an ignored extension are skipped.
- If you set a whitelist, only URLs containing a whitelist path are prerendered. With a blacklist, every URL except ones containing a blacklist path is prerendered.
Which AI crawlers the default list already covers
The current index.js on GitHub has entries such as 'oai-searchbot', 'ChatGPT-User/1.0', 'Anthropic/Claude', 'anthropic-ai' and 'PerplexityBot/1.0'. Your installed copy may be older than GitHub's, so read your own file, not the repo.
OpenAI and Anthropic each name more than one crawler, and they describe different jobs for them. Here's what each company says its crawlers are for, so you can decide which ones you want to get rendered HTML.
| Crawler name | Run by | What the company says it's for |
|---|---|---|
| GPTBot | OpenAI | "used to make our generative AI foundation models more useful and safe" |
| OAI-SearchBot | OpenAI | "OAI-SearchBot is for search." |
| ChatGPT-User | OpenAI | "certain user actions in ChatGPT and Custom GPTs" |
| ClaudeBot | Anthropic | "ClaudeBot is our training crawler" |
| Claude-SearchBot | Anthropic | "navigates the web to improve search result quality for users" |
| Claude-User | Anthropic | "Claude-User supports Claude AI users." |
If you care about showing up in AI search answers, check the search and user crawlers first. Open node_modules/prerender-node/index.js and search for each name in the table. Remember the substring rule: search for the name itself, not just the company.
Add the missing crawlers with addUserAgents
Prerender.io's guide recommends addUserAgents to add strings without replacing the default list. It's meant for prerender-node versions after v3.8.2, so check your package.json and update the package first if you're older. Here's their sample, copied as-is:
app.use(
require('prerender-node')
.set('prerenderToken', 'YOUR_TOKEN')
.addUserAgents(['your-custom-bot'])
.addUserAgents('another-bot')
);Swap the placeholder strings for the names your file is missing, for example 'Claude-SearchBot' and 'Claude-User'. It takes one string or an array. In the source, an entry is pushed only if the list doesn't already include that exact string, so a repeat is harmless.
Two things to avoid. Don't reach for .set('crawlerUserAgents', [...]) unless you mean it: the guide says it replaces the default list entirely, so you'd drop every default entry you didn't retype. And don't add broad strings. The guide warns to avoid matching broad strings, and even GPTBot's published user agent starts with Mozilla/5.0, so pick the part that names the bot.
Before you add anything, check what the crawler actually sends: look for its user-agent header in your server or CDN logs. Pick a piece of it that's specific to that bot, such as the bot's name, and use that as the entry.
Test it with the crawler's real user-agent string
Prerender.io's guide tests a new bot with curl -A and the bot's user agent. Use the full string the crawler sends, not just its short name, so you're testing the match you'll get in production. OpenAI publishes GPTBot's as Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.4; +https://openai.com/gptbot.
curl -s -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.4; +https://openai.com/gptbot" "<your page URL>" > as-crawler.html
curl -s "<your page URL>" > as-visitor.htmlThen open both files. If the crawler file has your page's real text, headings and links and the visitor file doesn't, that request was prerendered. If they look the same, check the list and the gates above.
If you use Prerender.io's own service, its verification guide points to the x-prerender-request-id header. Look for it in the response headers.
Still getting the shell? Work through these in order:
- Check the request method. Only GET and HEAD are prerendered.
- Check the URL. A path ending in an ignored extension, or one outside your whitelist, skips prerendering whatever the user agent.
- Check that the middleware runs before your static file handler, so the request reaches it at all.
- Check your installed version actually has your edit: log the crawlerUserAgents array once at startup.
If you're also weighing the prerender service itself
The crawler list lives in the middleware. The service it calls is a separate setting: prerender-node reads prerenderServiceUrl or the PRERENDER_SERVICE_URL environment variable, and sends your token in the X-Prerender-Token header. So the user-agent work above stays put whichever service you point it at.
That's the setup we built RenderSwap for, Bright Labs' hosted prerender service. You change two values, the service URL and the token, and your middleware stays.
Sources
- prerender-node source code with the default crawler list
- prerender-node middleware README on GitHub
- Prerender.io guide to adding additional bots
- Prerender.io guide to verifying your integration
- OpenAI's overview of its crawlers and user agents
- Anthropic's help article on its web crawlers
Questions
Does a ClaudeBot entry in prerender-node also cover Claude-SearchBot and Claude-User?
Not by name alone. prerender-node lowercases both sides and looks for each list entry inside the full user-agent header the crawler sends. The names Claude-SearchBot and Claude-User don't contain claudebot, so a ClaudeBot entry covers them only if their actual headers include that text somewhere else. Check the headers in your logs, or add each name as its own entry.
Should I replace the whole list with set('crawlerUserAgents', ...)?
Only if you really want to replace it. Prerender.io's guide says that replaces the default list entirely. To add a few bots and keep the defaults, use addUserAgents, which the guide recommends for prerender-node versions after v3.8.2.
Does a HEAD request get prerendered?
Yes. The middleware returns early for any method other than GET or HEAD, so both of those are eligible. A POST is never prerendered.
Do my user-agent changes survive switching to a different prerender service?
Yes. The crawler list is part of the middleware. The service URL and token are separate settings, so changing services means changing those two values while your addUserAgents calls stay as they are.
Related
- Prerender.io alternative pricing in 2026: what renders cost and what to compare before you switch
- Is dynamic rendering still OK for SEO? What Google says now about prerender services
- Can Google see your React content? How to check with the URL Inspection tool
- How to test that your prerender setup works: fetch the page as a crawler and read the HTML