Developer screens comparing a page's raw HTML source with its rendered DOM to check what Googlebot and AI crawlers see on a JavaScript site

JavaScript SEO Guide

JavaScript SEO: How Google Crawls, Renders and Indexes JavaScript Sites

Google can render JavaScript. That does not mean it always does it quickly, fully or the way you expect. And many AI crawlers do not render it at all. JavaScript SEO is making sure your content does not depend on luck.

What JavaScript SEO is

JavaScript SEO is the part of technical SEO that deals with sites built on JavaScript frameworks or that rely on JavaScript to show content, links or metadata. React, Next.js, Vue, Nuxt, Angular, Svelte and many site builders all fall into this space.

The core question is simple. When a search engine or AI crawler requests your page, does it get the content, or does it get an empty shell and a bundle of scripts? Everything in JavaScript SEO comes back to that.

How Googlebot processes JavaScript

Google describes three phases: crawling, rendering and indexing.

Crawling. Googlebot requests the URL and gets the raw HTML your server sends. It reads any links and content already in that HTML.

Rendering. If the page needs JavaScript, Google queues it for rendering. Google's Web Rendering Service loads the page in a headless version of Chromium that is kept up to date, runs the scripts and builds the final page.

Indexing. Google indexes the rendered result, including content and links that only appeared after scripts ran.

The catch is the queue. Rendering takes resources, so it can happen after crawling rather than at the same moment. For most pages the delay is short. But anything that depends on rendering, from the main text to internal links to the canonical tag, is only seen once rendering succeeds. If a script fails, times out or needs a user action, Google indexes whatever was there when rendering finished.

Why AI crawlers raise the stakes

Google has spent years building a rendering system. Most AI crawlers have not. Many of the bots that feed AI search and AI models fetch the raw HTML and read it as text, without running JavaScript.

That means a page that ranks fine in Google can be close to invisible to ChatGPT search, Perplexity or other AI tools if its content only exists after rendering. As more people ask AI tools instead of searching, that gap costs real visibility. My guide to llms.txt and AI crawlers covers how to decide which of these bots to allow in the first place.

The simple rule: if it matters, put it in the HTML your server sends.

Rendering methods compared

Rendering methods and what crawlers see

MethodHow it worksSEO risk
Client side renderingThe server sends a near empty page and the browser builds it with JavaScriptHighest. Google must render, many AI crawlers see little
Server side renderingThe server builds the full HTML for each requestLow. Content and links are in the first response
Static site generationPages are built to HTML ahead of time and served as filesLowest. Fast, complete HTML for every crawler
HydrationServer or static HTML first, then JavaScript adds interactivityLow, as long as the HTML already holds the content
Dynamic renderingBots get a pre rendered version, users get the JavaScript appWorkaround only. Google no longer recommends it
Most modern frameworks support server side rendering or static generation. The setting is often a choice, not a rebuild.

This site is built with Astro, which sends plain HTML by default and only adds JavaScript where a component needs it. Next.js, Nuxt, SvelteKit and similar frameworks can do server side rendering or static generation too. The question is whether your site is set up that way.

The JavaScript SEO problems I see most

JavaScript faults that hide pages from search

Links that are not links

Navigation built on click handlers or buttons with no href. Google follows real anchor links, not scripts.

Content behind interaction

Text that only loads after a click, tab change or scroll. Google does not click or type.

Metadata set by scripts

Titles, meta descriptions, canonicals or noindex tags changed by JavaScript after load, sending mixed signals.

Soft 404s in single page apps

Missing pages that show an error message but return a 200 status code to Google.

Blocked resources

JavaScript or API files blocked in robots.txt, so Google cannot render the page properly.

Slow, heavy bundles

Large scripts that delay content and hurt Core Web Vitals, especially INP and LCP.

Links. Googlebot discovers pages through anchor links with an href attribute pointing at a real URL. A menu built from divs with click handlers, or links that use a hash fragment for routing, may not be followed at all.

Status codes. In a single page app, every route often returns 200 from the server, even for pages that do not exist. Return a real 404 from the server, or add a noindex for error views, so Google does not index empty pages.

Metadata. If the server sends one title and JavaScript swaps it for another, Google may use either. Set titles, descriptions, canonical tags and robots directives in the server HTML and keep them stable.

Lazy loading. Lazy loading images is fine when done with native browser lazy loading or a method that does not need scrolling. Content that only loads when a user scrolls may never load for Google.

How to test JavaScript SEO

The SEO Fire Fighter Method

Testing what crawlers really see

  1. Compare source and rendered

    View the raw page source, then the rendered DOM. Anything only in the rendered version depends on JavaScript.

  2. Inspect in Search Console

    Run a live test with URL Inspection and read the rendered HTML and any page resource errors.

  3. Turn JavaScript off

    Load key pages with JavaScript disabled to see roughly what a non rendering crawler gets.

  4. Crawl both ways

    Run a site crawl with and without rendering and compare word counts, links and titles.

The comparison between raw HTML and rendered HTML is the single most useful check in JavaScript SEO. If the raw HTML has your headings, body text, internal links and metadata, you are in good shape for Google and for AI crawlers. If it is an empty div and a script tag, you are relying on rendering for everything.

JavaScript and performance

Heavy JavaScript hurts more than crawling. Large bundles delay the main content, which hurts Largest Contentful Paint. Long tasks on the main thread make the page slow to respond, which hurts Interaction to Next Paint. Both are Core Web Vitals. My Core Web Vitals SEO guide covers how to fix them. Rendering also costs Google resources, which can matter on large sites where crawl budget optimization is already a concern.

JavaScript SEO during a rebuild

The riskiest moment is a redesign or a move to a new framework. A site that ranked on plain HTML can lose rankings overnight if the new build moves content and links into client side JavaScript. Test the new build with the steps above before launch, on a staging site, and compare it page by page with the old one.

When to get help

JavaScript SEO problems are hard to see from the outside. The page looks perfect in a browser and is half empty to a crawler. If you suspect your framework is hiding content, or you are planning a rebuild, a technical SEO audit will show exactly what Google and AI crawlers receive, and the technical SEO checklist covers the wider checks around it.

FAQ

Can Google crawl JavaScript websites?

Yes. Googlebot renders pages with an up to date version of Chromium, so it can run most modern JavaScript. Rendering happens after crawling and can be delayed, and problems like blocked scripts, errors or content that needs a click can still leave Google with an incomplete page.

Do AI crawlers render JavaScript?

Many do not. Several AI crawlers fetch the raw HTML and read what is there without running scripts. If your main content, links or product details only appear after JavaScript runs, those tools may see an empty or partial page. Server side rendering or static HTML avoids this.

Is client side rendering bad for SEO?

Not automatically, but it carries the most risk. Google has to render the page to see the content, other search engines and AI crawlers may not, and performance often suffers. For pages that need to rank, server side rendering or static generation is the safer choice.

Is dynamic rendering still recommended?

No. Google now describes dynamic rendering, serving a pre rendered version to bots and the JavaScript version to users, as a workaround rather than a long term solution. It recommends server side rendering, static rendering or hydration instead.

Find out what crawlers really see.

Free strategy call. I read every request myself and reply with the next step.