AI search glossary
JavaScript SEO: rendering, SSR and why AI crawlers miss JS content
JavaScript SEO is the practice of making sure pages that rely on JavaScript to load or build their content can still be crawled, rendered and indexed by search engines, usually by serving the important content in the initial HTML through server-side rendering or pre-rendering.
Also called: JS SEO, SSR SEO, rendering SEO
Why it matters for AI search
Google renders JavaScript before indexing, but many AI crawlers do not. Vercel's analysis of crawler traffic in December 2024 found that GPTBot, ClaudeBot and PerplexityBot fetch JavaScript files without executing them. If your product names, prices or answers only appear after a script runs, those crawlers see an empty shell, and the AI answers built from them cannot quote you.
How Google handles JavaScript
Google describes three phases: crawling, rendering and indexing. Googlebot fetches the URL, then queues every page with a 200 status for rendering unless a robots meta tag says not to index it. A headless Chromium renders the page, and Google indexes the result. The page may wait in that queue for seconds or longer, and pages that return errors may never be rendered.
So Google can see JavaScript content, with a delay and with some conditions.
Why AI crawlers are different
AI crawlers are not built on Google's rendering service. Vercel's December 2024 analysis of crawler traffic on its network found that GPTBot, ClaudeBot and PerplexityBot download JavaScript files but do not execute them. Applebot, and Gemini through Google's infrastructure, do render. In practice that means a client-rendered page can be indexed by Google yet look nearly empty to the crawlers behind ChatGPT search, Claude and Perplexity.
A quick test: load your page with JavaScript disabled, or run curl against it and read the HTML. Whatever is missing there is missing for most AI crawlers.
What to do about it
- Server-render the important content. Main text, product details, prices, navigation and metadata belong in the initial HTML. Frameworks such as Next.js, Nuxt and Astro do this by default or with one setting; a plain client-side React app does not.
- Use real links. Google can only follow
aelements with anhref. Use the History API for routing, not#fragments. - Keep the canonical and robots tags in the HTML. Google may skip rendering when it sees
noindex, so removing it with JavaScript may not work. Set one canonical tag in the source and do not rewrite it. - Return real status codes. In single-page apps, missing pages should return 404 or carry
noindex, not a soft 404 with a 200 status. - Put structured data in the source. Google can read JSON-LD injected by scripts, but says dynamically generated Product markup makes Shopping crawls less reliable.
- Fingerprint asset filenames. Google's renderer may ignore caching headers, so versioned filenames prevent stale scripts.
SSR, SSG and pre-rendering
Server-side rendering (SSR) builds HTML per request. Static generation builds it once at deploy time. Pre-rendering serves a rendered snapshot to clients. All three put content into the first response, which is what matters for crawlers that will not run your scripts. Check which crawlers reach your pages in the AI crawler directory.
Questions
- Can Google index JavaScript content?
- Yes. Google crawls the page, queues it for rendering, runs the JavaScript in a headless browser and indexes the rendered HTML. Rendering can be delayed, and pages with a noindex tag or a non-200 status may skip it.
- Do AI crawlers render JavaScript?
- Most do not, according to Vercel's December 2024 analysis of its network: GPTBot, ClaudeBot and PerplexityBot downloaded JavaScript files but did not execute them, while Applebot and Google's infrastructure (which Gemini uses) render it.
- Is server-side rendering better for SEO?
- For content you want found, yes. Google calls server-side rendering or pre-rendering still a great idea because it is faster for users and crawlers and because not all bots can run JavaScript.
- Is client-side rendering always bad?
- No. It is fine for parts that do not need to be indexed, such as live chat, carts or view counters. The problem is only when the main content, links or metadata exist solely after scripts run.