JavaScript SEO
Last reviewed
JavaScript SEO is making sure crawlers can read content that your site builds with JavaScript. Google renders JavaScript in a headless Chromium, usually with a delay, but the major AI crawlers (OpenAI, Anthropic, Perplexity and others) do not run JavaScript at all, so they only see the HTML your server sends.
What GPTBot sees
<body> <div id="root"></div> <script src="/app.js"> </body>0 words
With Prebaked
Example page. Bots and people get the same content: the page your visitors' browsers already build.
Who renders JavaScript
| Crawler | Used for | Runs JavaScript | Source |
|---|---|---|---|
| Googlebot | Google Search | Yes, in a render queue | Google Search Central |
| Gemini | Google's AI | Yes, uses Googlebot's infrastructure | Vercel and MERJ, Dec 2024 |
| AppleBot | Apple | Yes, browser-based crawler | Vercel and MERJ, Dec 2024 |
| GPTBot, OAI-SearchBot, ChatGPT-User | OpenAI training, ChatGPT search, user requests in ChatGPT | No | Vercel and MERJ, Dec 2024; OpenAI |
| ClaudeBot | Anthropic | No | Vercel and MERJ, Dec 2024 |
| PerplexityBot | Perplexity search results | No | Vercel and MERJ, Dec 2024; Perplexity |
| Meta-ExternalAgent, Bytespider | Meta, ByteDance | No | Vercel and MERJ, Dec 2024 |
How Google handles JavaScript
Google processes JavaScript web apps in three phases: crawling, rendering and indexing.
- Crawling. Googlebot fetches the HTML and reads links from it.
- Rendering. "Googlebot queues all pages with a 200 HTTP status code for rendering." When resources allow, a headless Chromium runs the JavaScript. "The page may stay on this queue for a few seconds, but it can take longer than that."
- Indexing. Google indexes the rendered HTML.
How long is the queue in practice? Vercel and MERJ analysed over 100,000 Googlebot fetches on nextjs.org in April 2024. All HTML pages were fully rendered, including pages with complex JavaScript. The delay from crawl to render was 10 seconds at the median, about 3 hours at the 90th percentile and about 18 hours at the 99th percentile.
So Google can index a JavaScript site. Google still says "server-side or pre-rendering is still a great idea", because it is faster for people and crawlers, and "not all bots can run JavaScript".
Why AI crawlers are different
Vercel and MERJ found in December 2024 that "none of the major AI crawlers currently render JavaScript". ChatGPT and Claude crawlers do fetch JavaScript files (11.50% and 23.84% of their requests), but they do not execute them, so "they can't read client-side rendered content".
These crawlers decide what AI assistants can find and quote. OpenAI says OAI-SearchBot "is used to surface websites in search results in ChatGPT's search features". Perplexity says PerplexityBot "is designed to surface and link websites in search results on Perplexity". Anthropic says blocking Claude-SearchBot stops content from being indexed for search.
The traffic is growing. Cloudflare reported that GPTBot requests rose 305% and ChatGPT-User requests 2,825% between May 2024 and May 2025.
Ranking on Google tells you nothing about how ChatGPT sees your site. More on how AI crawlers see your site and whether ChatGPT can read JavaScript.
CSR vs SSR for SEO
| Client-side rendering (CSR) | Server-side rendering (SSR) or static generation (SSG) | CSR with prerendering | |
|---|---|---|---|
| HTML from the server | Empty shell and scripts | Finished page | Finished page for crawlers, shell for people |
| Indexed after rendering, with a delay | Indexed from the first fetch | Indexed from the first fetch | |
| AI crawlers | Empty page | Full page | Full page |
| Change to your app | None | Framework and hosting change | One snippet in front of the site |
Google's long-term recommendation is "server-side rendering, static rendering, or hydration". It describes dynamic rendering (prerendering for crawlers) as "a workaround and not a long-term solution", and says that as long as it "produces similar content, Googlebot won't view dynamic rendering as cloaking".
JavaScript SEO checklist
- Content in the HTML. Check what the server sends before any JavaScript runs.
- Crawlable links. Use
<a href="...">. Google "can only crawl your link if it's an<a>HTML element" with anhref.onclickhandlers and<span href>do not count. - Real URLs. Use the History API, not
#/fragments. Google deprecated the AJAX crawling scheme in 2015. - Real status codes. A missing page should return 404 or carry
noindex. In an SPA a 200 error page "can lead to error pages being indexed". - Titles and meta tags per page, in the HTML, not only set by JavaScript.
Framework specifics: React SEO, single page application SEO and Lovable, Bolt and v0.
How to check your site
- Run the free checker. It fetches your page without JavaScript and in a real browser and compares words and headings.
See what ChatGPT sees on your site
- Compare the raw HTML with what you see in the browser.
curl -s https://www.<your-domain>/ | sed -e "s/<[^>]*>/ /g" | wc -w
This counts the words in the HTML without running JavaScript. A handful of words on a page full of text means crawlers that do not run JavaScript miss most of it.
- For Google, use the URL Inspection tool in Search Console or the Rich Results Test to see the rendered HTML.
Your options
- Server-side rendering or static generation. The most complete fix and Google's recommendation. Best for new sites and planned rebuilds. Costs a migration.
- Build-time prerendering. Saves an HTML file per route at build time. Best for small sites with few routes that change only on deploy.
- A prerender service. Renders pages in a real browser when a crawler asks and serves them from a cache. Best for existing JavaScript sites where a migration is not worth it now.
When Prebaked is the right choice
Prebaked is a prerender service for JavaScript sites that work for people but not for AI crawlers.
- Add one snippet: Cloudflare Worker, Express or another integration.
- Crawlers, including GPTBot, OAI-SearchBot and ClaudeBot, get the page rendered in Chromium. People get your site as before.
- The content is the same for both. Prebaked does not add or change anything for bots.
- If Prebaked is slow or down, crawlers get your original page. Never worse than today.
- Cache hits are free, and you can see which bots fetched which pages.
Prebaked does not guarantee rankings or AI mentions. It makes sure crawlers can read your page.
FAQ
Is JavaScript bad for SEO?
Not for Google, which renders JavaScript, though with a delay. It is a problem for AI crawlers, which do not run JavaScript and see only the HTML your server sends.
Does Google render JavaScript?
Yes. Google queues pages for rendering and runs them in a headless Chromium. In a study of nextjs.org, the median delay from crawl to render was 10 seconds and the 99th percentile about 18 hours.
Do AI crawlers run JavaScript?
The major ones do not. Vercel and MERJ found that crawlers from OpenAI, Anthropic, Meta, ByteDance and Perplexity do not render JavaScript. Gemini and AppleBot do.
Is SSR better than CSR for SEO?
Yes. Server-side rendering sends the finished page on the first request, so every crawler can read it. Client-side rendering depends on the crawler running JavaScript. Prerendering gives crawlers the same result without changing your app.
Is prerendering for crawlers cloaking?
Not when the content is the same. Google says that as long as dynamic rendering produces similar content, Googlebot does not view it as cloaking.