⚙️ Technical SEO · Advanced · 22 min

JavaScript SEO: how Google renders your pages and how to avoid invisible content

Modern websites built with React, Vue, Angular or Next.js lean heavily on JavaScript to build the page a user actually sees. The problem is that search engines do not experience your site the way a browser does. Googlebot has to fetch your files, queue them, execute the JavaScript, and only then can it read the content the script generated. Content can silently disappear anywhere in that pipeline, so a page that looks perfect to you can be indexed as a near-empty shell.

Key takeaways
  • Google crawls, then renders in a separate queued wave, then indexes. Content (and links) that exist only after JavaScript runs are indexed later and less reliably.
  • WRS uses evergreen Chromium but does not click, scroll or fill forms, ignores client-side-only status codes, caches JS/CSS up to 30 days, and fetches ~2MB per file.
  • Use SSG, ISR or SSR for content that must rank. Dynamic rendering is deprecated, islands/partial hydration are rising, and pure CSR is risky for anything that needs visibility.
  • Most AI crawlers (GPTBot, ClaudeBot, PerplexityBot) execute no JavaScript, so your core content and links must live in the raw HTML to be cited. Among the major ones, only Google's Gemini renders.
  • Diagnose by diffing raw HTML against the rendered DOM with Search Console, and run a dual (text vs JavaScript) crawl in Screaming Frog, Sitebulb or a log-aware crawler for scale.
  • The same HTML-first architecture that fixes crawlability also improves Core Web Vitals (LCP, CLS, INP), so optimize rendering once and win on ranking, AI citation and page experience.

What JavaScript SEO is and why it matters more in 2026

JavaScript SEO is the practice of making sure that content generated or modified by JavaScript can still be discovered, read and indexed by search engines and, increasingly, by AI answer engines. It sits where front-end engineering meets technical SEO. The same architectural choices that make an app feel fast and interactive for users can hide your titles, copy, links and structured data from the machines that decide whether you get found.

For most of the last decade this was treated as a niche Google problem. In 2026 it is a mainstream visibility problem. Two forces converged. Google tightened how much of each file it will fetch and how it caches your scripts, and a whole new class of crawlers (the ones feeding ChatGPT, Perplexity, Gemini and Google AI Overviews) started driving meaningful traffic and citations. The crucial difference is that most of these AI crawlers do not run JavaScript at all. A page can rank at position one on Google and be completely invisible to the engine that writes the AI answer a user reads instead of clicking.

The mental model to keep for the rest of this guide is simple. Treat the raw HTML response (the bytes that arrive before a single line of JavaScript executes) as your source of truth for discoverability. Everything that only appears after script execution is a bonus that Google usually delivers and AI crawlers usually do not, and you should never depend on it for content that has to rank or be cited.

The three phases: crawling, rendering, indexing

Google processes a page in three distinct steps. First it crawls: Googlebot fetches the raw HTML and immediately extracts any links and text already present in that markup. Second it renders: URLs that depend on JavaScript are placed in a render queue, where the Web Rendering Service (WRS) runs a headless, evergreen Chromium browser to execute the script and produce the final DOM. Third it indexes the content found in that rendered DOM. Because rendering is decoupled from crawling, there can be a gap between the two waves. It usually lasts seconds to minutes, but it can stretch to days or, on low-priority pages, weeks when crawl demand and rendering capacity are tight.

The practical consequence is that anything present only after JavaScript execution is indexed later, and never as reliably, as content in the initial HTML response. If your title, your main copy, your internal links or your structured data exist only in the rendered DOM, you are betting your visibility on the second wave always completing correctly. It usually does for Google, but every extra dependency is one more thing that can fail, and the longer the queue, the longer fresh content stays out of the index.

There is a second-order effect that catches many teams off guard: link discovery is also queued. If a key category page links to your newest product pages only via JavaScript-rendered anchors, Google cannot enqueue those product URLs for crawling until it has rendered the category page. JavaScript dependencies do not delay just one page. They slow the propagation of your entire link graph, which is exactly what you do not want during a launch or a migration.

What the Web Rendering Service can and cannot do

WRS runs on an evergreen Chromium engine, kept close to the current public Chrome version. That means it supports modern ES6+ syntax, async/await, Promises, the Fetch API, JSON-LD injected via JavaScript, and even content inside the shadow DOM. In practice, a well-built SSR or hydrated application is rendered fully and indexed correctly the large majority of the time.

The hard limits are predictable. WRS does not click, scroll, hover, accept cookie banners or fill in forms, so any content that appears only after a user interaction is effectively invisible. It does not download images or videos during rendering, and it will not wait indefinitely for slow API calls, so XHR requests that resolve too late can be missed. It uses a stateless rendering session, so anything stored only in localStorage or sessionStorage from a previous visit is gone. And HTTP status codes, canonical tags or redirects that you only set client-side via JavaScript are unreliable: Google reads the status code and headers it received when it fetched the file, not the one your script tries to simulate.

Two further constraints matter for large pages. As Google's Gary Illyes detailed in the March 2026 post 'Inside Googlebot', Googlebot fetches at most about 2MB per individual file (HTTP header included, measured uncompressed, PDFs excepted) and stops reading at that cutoff. Each referenced resource, like a separate JS or CSS file, has its own 2MB counter, so the limit bites hardest on a single bloated HTML document or bundle. This is why placing your title, meta tags, canonical and core structured data high in the HTML is now an explicit Google recommendation. Anything below the cutoff may never be seen.

Caching also changes the timing of your fixes. WRS caches your JavaScript and CSS for up to 30 days independently of your HTTP cache headers. If you ship a fix that moves content into the rendered output but your bundle filename does not change, Googlebot may keep rendering with the stale script for weeks. Use cache-busting filenames (content hashes) so a deploy forces a re-fetch. And remember that blocking your JS or CSS in robots.txt stops WRS from rendering at all, one of the most common self-inflicted indexing problems.

Rendering strategies: SSR, SSG, ISR, CSR and partial prerendering

Server-side rendering (SSR) generates the full HTML on the server for each request, so the content is in the initial response and the browser hydrates it into an interactive app afterwards. Static site generation (SSG) does the same work at build time and serves pre-rendered HTML files, which is ideal for content that does not change on every request. Incremental static regeneration (ISR) is the middle ground: static pages rebuilt on a schedule or on demand, giving you SSG speed with fresher data. Client-side rendering (CSR) sends a near-empty HTML shell and builds everything in the browser with JavaScript, putting all the indexing weight on the render queue.

The 2026 recommendation is clear: use SSG or ISR by default for content-heavy pages, SSR where the content is genuinely dynamic per request, and reserve pure client-side JavaScript for interactive widgets, never for content that needs to rank. A newer option worth knowing is Partial Prerendering (PPR), where a framework like Next.js serves a static HTML shell instantly from the edge and streams the dynamic 'holes' in afterwards. The key SEO point is that the parts you care about for indexing (the headline, the body, the links) should live in the static shell, not in the streamed-in holes.

Choosing is mostly about how often the data changes and whether it is unique per user. A marketing blog or documentation site is a textbook SSG case. A marketplace with prices that change hourly fits ISR or SSR. A logged-in dashboard nobody needs indexed is the one legitimate home for CSR. Frameworks like Next.js, Nuxt, Astro and SvelteKit make SSR/SSG the path of least resistance, so there is rarely a good reason to ship important content as CSR-only.

Why dynamic rendering is dead and islands architecture is rising

Dynamic rendering (the old workaround of serving a pre-rendered version only to bots) is no longer recommended for new sites and has disappeared from Google's own guidance. It relies on detecting user agents, which means you have to maintain a list of every crawler you want to serve, and that list breaks the moment a new AI crawler appears. It also drifts toward cloaking risk because bots and users receive different responses. Treat dynamic rendering as a temporary migration patch, not as an architecture.

The architecture trending in its place is the islands model (also called partial hydration), used by Astro and available in other frameworks. The page ships as mostly static HTML, and only the genuinely interactive components (the 'islands') get hydrated with JavaScript. Because the content lives in the static HTML and only widgets carry script, crawlers that do not render still see everything that matters, and JavaScript execution time on the client drops sharply, which helps Core Web Vitals at the same time.

The throughline across both points is that the industry is converging on one principle: HTML-first, JavaScript-second. You can reach it through SSG, ISR, islands or partial prerendering, but the destination is the same. Ship the meaning in the markup, and use JavaScript to enhance the page rather than to constitute it.

Why AI crawlers raise the stakes in 2026 (the GEO angle)

Googlebot is now the forgiving one. As of 2026, the crawlers behind AI answer engines (GPTBot and OAI-SearchBot for ChatGPT, ClaudeBot and Claude-SearchBot for Claude, PerplexityBot, Meta's agents) do not execute JavaScript at all. They fetch the raw HTML, extract what they find, and move on with no second attempt. Large-scale log analyses of these crawlers have found no evidence of JavaScript execution. The one notable exception is Google's Gemini, which reuses Googlebot's WRS and can therefore render, with all the same queue-and-cache caveats. If your content only materializes after script execution, the non-rendering engines see an empty page and cannot quote, summarize or recommend you in their answers.

This reframes the whole discipline. JavaScript SEO in 2026 is no longer mainly a Google problem. It is a visibility problem across every engine that does not render, and that slice is growing fast. AI crawler traffic and AI-driven search visits have climbed sharply year over year, so the number of users getting an answer from a non-rendering engine, rather than clicking a blue link, keeps expanding. This is the heart of GEO (Generative Engine Optimization): if you want to be cited, the citable text must be in the HTML.

The safest test you can apply is blunt: if your core content and links are present in the HTML before any JavaScript runs, you are safe everywhere. If they are not, you are invisible to a growing slice of the search ecosystem no matter how well Google handles your site. Pair this with the usual GEO hygiene (clear headings, self-contained answer paragraphs, FAQ blocks and accurate structured data in the raw HTML) and you cover both classic ranking and AI citation at once.

Step-by-step: diagnose invisible content in 20 minutes

You can audit a single page quickly with tools you already have. Follow this sequence:

  1. See the raw HTML. Run `curl -A "Googlebot" https://yoursite.com/page` or open view-source in the browser. This is what every non-rendering crawler sees. Search it (Ctrl+F) for a sentence from your main copy, your H1, and a few internal link URLs.
  2. See the rendered DOM. In Chrome DevTools, open the Elements panel, which shows the live DOM after JavaScript. Or use the URL Inspection tool in Google Search Console, click 'Test live URL', then 'View tested page' to read the rendered HTML and screenshot Googlebot produced.
  3. Diff the two. If your headline, body copy, links or structured data appear in step 2 but are missing in step 1, you have found content that depends on rendering. That is workable for Google but invisible to most AI engines.
  4. Check what is blocked. In the URL Inspection result, look at 'Page resources' for any JS or CSS reported as blocked. A blocked script can break rendering entirely.
  5. Validate structured data with the Rich Results Test, confirming it is present in the raw response and not only after script execution.

A useful shortcut for the AI angle: temporarily disable JavaScript in your browser (DevTools command menu > 'Disable JavaScript') and reload the page. What remains on screen is roughly what GPTBot, ClaudeBot and PerplexityBot get. If the page collapses to a spinner or a blank shell, you have your answer before you even open Search Console.

Step-by-step: audit JavaScript dependencies at scale

The single-page method does not survive a 10,000-URL site. To find at-risk pages across the whole property, run a dual crawl and diff the results:

  1. In Screaming Frog or Sitebulb, crawl the site once in plain text-only / 'Old AJAX' mode (JavaScript rendering off).
  2. Crawl it a second time with JavaScript rendering enabled.
  3. Compare the two crawls field by field. Pages where the title, meta description, word count, H1 or internal link count appear only in the rendered crawl are your at-risk pages.
  4. Sort by traffic or revenue value and fix the highest-impact pages first.
  5. Re-crawl after deploying fixes to confirm the content now appears in the text-only pass.

For enterprise sites, cloud crawlers like Lumar (formerly Deepcrawl), Oncrawl or Botify run the same JavaScript-vs-raw comparison on millions of URLs and tie it to log-file data, so you can see where the gap is and how often Googlebot and AI bots actually hit those URLs. The combination of a rendered/non-rendered diff plus crawl logs is the most defensible way to prioritize remediation by real impact rather than gut feel.

How to fix it: worked patterns that work

The fixes follow from the diagnosis. The most reliable move is to move critical content into the server-rendered HTML: titles, meta tags, canonical tags, the H1, the primary body copy and your structured data. In Next.js this means rendering the page through a Server Component or a `generateMetadata`/SSG path rather than fetching the copy in a client `useEffect`. In Nuxt it means `useAsyncData` on the server, and in Astro it is the default. The test of success is unchanged: the text shows up in `view-source`.

For navigation, use real `<a href>` anchor tags for internal links rather than `onClick` handlers or `<div>`s wired up with JavaScript. WRS discovers links from href attributes, it does not click them, and non-rendering AI crawlers extract only href-based links. Use the History API for client-side routing, never `#!` fragment URLs to load different content. Avoid lazy-loading primary content behind scroll or interaction. Reserve lazy-loading for below-the-fold images and follow Google's lazy-loading guidelines so anything important loads eagerly.

Handle status and metadata server-side. Return a real HTTP 404 for missing pages instead of a client-rendered 'not found' on a 200 (a soft 404), set canonical and redirect rules on the server, and make sure your JS/CSS are crawlable in robots.txt. Finally, mind the WRS cache: ship bundles with content-hashed filenames so that when you push a fix, Googlebot is forced to re-fetch rather than rendering with a script cached for up to 30 days.

Common mistakes and pitfalls to avoid

Most JavaScript SEO disasters come from a short list of recurring mistakes. Watch for these:

  • Blocking JS/CSS in robots.txt so WRS cannot render at all.
  • Client-only routing with `onClick` instead of `<a href>`, which hides your internal link graph.
  • Soft 404s: returning HTTP 200 with a JavaScript 'page not found' message.
  • Lazy-loading or tabbing away primary content so it only appears after interaction WRS never performs.
  • Injecting canonical, hreflang or noindex via JavaScript, which Google may read late or inconsistently. Set these server-side.
  • A single bloated HTML or JS bundle over ~2MB, where important markup falls past the fetch cutoff.
  • Stale-bundle blindness: deploying a fix under the same filename and assuming Google sees it immediately, when WRS may cache the old script for weeks.

A subtler trap is the hydration mismatch. When the server-rendered HTML does not match what React or Vue expects on the client, the framework can tear down and rebuild the DOM, locking the main thread and hurting INP. In bad cases Googlebot indexes a skeleton state captured mid-rebuild. Keep server and client output identical, gate browser-only logic behind effects that run after hydration, and watch for hydration warnings in the console. They are not just developer noise. They can become indexing bugs.

Advanced: JavaScript, Core Web Vitals and INP

Rendering strategy and page experience are the same problem viewed from two angles. The three Core Web Vitals in 2026 are LCP (Largest Contentful Paint), CLS (Cumulative Layout Shift) and INP (Interaction to Next Paint), which replaced FID in March 2024. Heavy client-side JavaScript hurts all three: a large bundle delays the largest element (LCP), late-loading content shifts the layout (CLS), and long tasks on the main thread make interactions feel sluggish (INP, where the target is under 200ms).

The good news is that the fixes for crawlability and the fixes for Core Web Vitals overlap heavily. Code splitting and bundle splitting keep any single file under the 2MB fetch limit and cut main-thread work. Partial hydration / islands hydrate only interactive components, which can reduce JavaScript execution time dramatically. Streaming SSR with Suspense boundaries lets the shell paint fast for LCP while each section hydrates as its own smaller task, keeping INP responsive, and skeleton fallbacks that reserve space protect CLS.

The practical takeaway for advanced teams: do not treat SEO rendering and performance as separate workstreams with separate owners. The architecture that ships meaning in the HTML and ships the minimum JavaScript needed for interactivity is the one that wins on classic ranking, AI citation and page experience at the same time. You optimize once and the benefit lands in three places.

Întrebări frecvente

Does Google index JavaScript content at all?

Yes. Googlebot renders JavaScript with an evergreen Chromium engine and indexes the resulting content very reliably. The caveat is that rendering happens in a separate, queued wave after the initial crawl, so JS-dependent content is indexed later and is more fragile than content already present in the raw HTML.

Is client-side rendering still safe for SEO in 2026?

For purely interactive apps that you do not want indexed, like logged-in dashboards, CSR is fine. For any content that needs to rank or be cited, it is risky: Google can usually render it but most AI crawlers cannot, so you should serve that content via SSR, SSG or ISR instead.

How do I check what Google actually sees on my page?

Use the URL Inspection tool in Google Search Console: 'Test live URL' shows you the rendered HTML and a screenshot of what Googlebot produced. Compare that against the raw source (view-source or curl) and, for scale, run a JavaScript crawl in Screaming Frog or Sitebulb against a text-only crawl.

How do I know if AI engines like ChatGPT or Perplexity can read my page?

Disable JavaScript in your browser (Chrome DevTools command menu, 'Disable JavaScript') and reload, or fetch the page with curl. What remains is essentially what GPTBot, ClaudeBot and PerplexityBot see, because as of 2026 those crawlers do not execute JavaScript. If your main content, headings and links vanish, AI engines cannot cite you. Only Google's Gemini renders JavaScript among the major AI crawlers.

I deployed a fix but Google still shows the old content. Why?

Two queues are working against you. Rendering is queued and can lag the initial crawl by days, and WRS caches your JavaScript and CSS for up to 30 days independently of your HTTP cache headers. If your bundle filename did not change, Googlebot may keep rendering with the old script. Ship content-hashed filenames so a deploy forces a re-fetch, then request reindexing in Search Console.

Should I still use dynamic rendering or prerendering services?

Dynamic rendering is no longer recommended for new builds and has disappeared from Google's own guidance. It depends on maintaining a fragile list of user agents and risks cloaking. Prefer SSR, SSG, ISR or an islands architecture so the same HTML is served to everyone. A prerendering service can be a reasonable short-term patch during a migration of a legacy CSR app, but plan to move to a rendering strategy that ships content in the HTML for all crawlers.

Recommended tools