Aller au contenu
SEO Fundamentals

JavaScript and SEO: Rendering and Indexing

9 min

Google can render JavaScript, but with a delay that can range from a few seconds to several weeks depending on site authority. Critical content (main text, links, structured data) must not depend on JavaScript to be visible. Server-Side Rendering (SSR) or prerendering are the recommended solutions.

Modern JavaScript frameworks (React, Vue, Angular, Next.js) dominate web development. But their relationship with SEO remains complex: while Google has progressed in JS rendering, the risks of partial or delayed indexing are real and costly.

How Google handles JavaScript

Googlebot downloads the initial HTML of the page, then places JavaScript rendering in a queue (WRS — Web Rendering Service). Full rendering can happen seconds, days, or even weeks later depending on site popularity and engine load.

This rendering delay means JS-only content is systematically indexed later than static HTML content. On a low-authority site, some content may never be correctly rendered.

Concrete risks for indexing

Content displayed only after a user interaction (click, scroll, tab) is never seen by Googlebot. FAQ accordions, content tabs, and hover content are the most common cases.

Links dynamically generated by JavaScript are not always followed by Googlebot. If your internal linking relies on links created after page load, part of your architecture remains invisible to the crawler.

  • Content behind a click or hover event: not indexed.
  • Links in a pure JS hamburger menu without HTML fallback: potentially ignored.
  • JSON-LD structured data injected via JS: delayed rendering, rich results eligibility deferred.
  • Client-side generated meta tags: title and description potentially absent during first crawl.
  • Pagination text loaded via AJAX without a dedicated URL: invisible content.

Recommended solutions

Server-Side Rendering (SSR) generates complete HTML on the server before sending it to the browser. Googlebot receives rich HTML from the first crawl, without waiting for JavaScript rendering. Next.js, Nuxt.js, and SvelteKit offer SSR natively.

Static Site Generation (SSG) pre-generates pages at each build. Even faster than SSR, but only suitable for infrequently updated content.

If an SSR refactor is not feasible, prerendering via a service like Rendertron or Prerender.io detects Googlebot and serves it a pre-rendered static HTML version of the page.

Sites migrating from a SPA (Single Page Application) architecture to SSR see an average improvement of 20 to 50% in the number of indexed pages within 60 days of migration.

Sector studies 2025-2026 on SSR migrations and indexing

Diagnosing JS rendering problems on your site

The URL inspection tool in Search Console offers a screenshot of the page as Googlebot sees it. Compare this screenshot with the actual display in your browser: any gap reveals a rendering problem.

Also test by disabling JavaScript in Chrome (DevTools > Settings > Debugger > Disable JavaScript): if your page displays nothing or loses its navigation links, you have a critical SEO problem to resolve.

FAQ

Can Google correctly index a SPA (Single Page Application)?

Yes, but with limitations and delays. SPA content is indexed after JavaScript rendering, which can take several weeks. On competitive sites, this delay is a real disadvantage. SSR or prerendering remains the most reliable solution.

Is Next.js a good choice for SEO?

Yes, it is one of the most SEO-friendly frameworks on the market. It offers SSR, SSG, and ISR (Incremental Static Regeneration) natively. Meta tags, sitemaps, and structured data can be generated server-side without complex configuration.

Is content in tabs or accordions indexed?

Google states that content hidden by CSS (display:none or visibility:hidden) can be indexed but with reduced weighting. Content behind a JavaScript interaction is more problematic. For FAQs or key information, prefer native HTML display with details/summary elements or ensure content is present in the initial HTML.

Should JavaScript be made compatible for all bots, or just Google?

Google is the only engine that actively renders JavaScript. Bing is making progress but remains behind. If your audience comes primarily from Google, focus your efforts on Googlebot compatibility. An SSR architecture automatically benefits all bots.