Technical SEOAdvanced

JavaScript SEO

JavaScript SEO is the practice of making sure pages built with JavaScript can be crawled, rendered and indexed by search engines and AI crawlers.

Also called: JS SEO

JavaScript SEO deals with sites where some or all of the content, links or metadata are produced by JavaScript in the browser. Google can render JavaScript, but it adds a step that can delay or break indexing, and many other crawlers, including many AI crawlers, are reported to read only the raw HTML. The safest pattern is to send the important content and links in the initial HTML and use JavaScript to enhance it.

How Google processes JavaScript

Google describes three phases: crawling, rendering and indexing. Googlebot fetches the HTML, then queues the page for rendering in an up-to-date (evergreen) version of Chromium, then indexes the rendered result. Rendering usually happens soon after crawling but can be delayed. Content and links that exist only after rendering are discovered later than ones in the raw HTML.

Googlebot does not click, scroll or type, does not keep state between page loads, and declines permission prompts. Content that appears only after those actions will not be seen.

Rendering patterns, from safest to riskiest

Modern frameworks support several of these. Next.js with the App Router renders on the server by default, Nuxt, SvelteKit, Astro and Remix all support server or static output. The risk usually comes from specific components marked client-only that hold important content.

Dynamic rendering, serving pre-rendered HTML only to bots, is described by Google as a workaround it no longer recommends. Server or static rendering is the long-term answer.

  • Static generation: HTML built ahead of time, every crawler sees full content
  • Server-side rendering: HTML built per request on the server
  • Hybrid: server-rendered shell and main content, client-side enhancements
  • Client-side rendering: an almost empty HTML file filled in by JavaScript

Checks for any JavaScript-heavy page

A short checklist catches most problems.

  • View the raw HTML (not the DevTools DOM) and confirm the main text, title, meta description, canonical and links are present
  • Use URL Inspection in Search Console to see Google's rendered HTML and screenshot
  • Make sure links are a elements with real href values, not click handlers
  • Give each view its own URL using the History API, not # fragments
  • Return real HTTP status codes from the server, not client-side error screens
  • Do not block JavaScript or API endpoints needed for rendering in robots.txt

AI crawlers and JavaScript

Several AI crawlers are widely reported to fetch HTML without executing JavaScript, though vendors rarely document rendering behavior and it can change. If a page's content only appears after client-side rendering, assume those crawlers see an empty shell. That is a strong reason for SaaS companies that want to be cited in AI answers to server-render docs, comparison pages and pricing.

Example

A docs site built as a single-page app

A fictional API platform, Relayform, builds its docs as a client-side React app. Google indexes many pages after rendering, but slowly, and the raw HTML for every page is the same empty div with a generic title. Third-party AI assistants asked about Relayform's API seem to know little about it.

Moving the docs to static generation means every page ships its full text, title and links in HTML. Google indexes changes faster and any crawler that reads HTML now sees the content.

Common mistakes

Checking the DOM instead of the source

Browser DevTools shows the rendered DOM. Crawlers that do not run JavaScript see the raw response. Check both.

Setting metadata only on the client

Titles, canonicals and robots tags injected late by JavaScript may be missed or applied inconsistently. Render them on the server.

Client-side 404s

A router that shows "not found" while the server returns 200 creates soft 404s.

Questions

Yes, Google renders JavaScript with a current version of Chromium. The risks are delays, rendering failures, and features Googlebot does not support, such as interactions.

Bing has said it can render JavaScript but recommends server-side or static rendering for important content, especially at scale.

It is fine for logged-in app screens and interactive tools that do not need to rank. For pages meant to be found, server or static rendering is safer.

Know the terms. Now win the searches.

We find the searches your buyers make, then build, publish and improve the pages that win them.