Search all pages  ·  Press Esc to close  ·  ↑↓ to navigate
Content Strategy Local SEO GMB Prompts Technical SEO E-E-A-T Guest Post GA4 Analytics
Technical SEO · AlgoBlueprints · November 2026

JavaScript SEO: How Google Renders JS Sites (and How to Fix What Breaks)

Add as Preferred Source on Google
Table of Contents

JavaScript SEO is the work of making sure search engines can crawl, render and index the content, links and metadata that JavaScript produces on your pages. Google can run JavaScript, but it only indexes what shows up in the rendered HTML, so your job is to make sure the important parts are there, ideally in the first HTML response.

Key takeaways

I build sites for clients as well as doing their SEO, so I see JavaScript problems from both sides. The developer says "Google renders JavaScript now." The SEO says "the page isn't indexed." Both are usually right. This guide explains why, and what to change.

What is JavaScript SEO?

Developer writing JavaScript code on two monitors, with the headline JavaScript SEO
Content that only appears after JavaScript runs needs extra checks.

JavaScript SEO (often shortened to JS SEO) is a part of technical SEO. It covers sites built with frameworks like React, Vue, Angular and Svelte, and any site that uses JavaScript to load content, links, titles, canonical tags or structured data.

The core question is simple: what does a crawler see before and after JavaScript runs? If your main content, internal links and meta tags only exist after JavaScript runs, you depend on the crawler rendering the page. Google does that. Many other bots don't.

If you're still choosing a stack, I compare options in the best language for an SEO-friendly website. This post assumes you already use JavaScript and want it indexed.

Does JavaScript affect SEO?

Yes, but JavaScript itself isn't the problem. The problems come from how it's used. In my audits, JavaScript causes SEO issues in four ways:

  1. Content missing from the rendered HTML. It loads only after a click, a scroll or a failed API call.
  2. Links Google can't follow. Navigation built with onclick handlers instead of <a href>.
  3. Wrong signals in the raw HTML. A noindex, canonical or title in the first response that JavaScript later changes.
  4. Wrong status codes. A single-page app (SPA) that returns 200 for pages that don't exist.

Google is open about this. Its JavaScript SEO basics guide is mostly a list of these exact traps.

How Google crawls, renders and indexes JavaScript

Google describes three phases: crawling, rendering and indexing.

1. Crawling. Googlebot checks robots.txt, then fetches the URL. It reads the HTML response and queues any links it finds there.

2. Rendering. Google queues pages that return a 200 status for rendering. Its Web Rendering Service runs the page in a headless Chromium and executes the JavaScript. Google's docs say a page "may stay on this queue for a few seconds, but it can take longer than that." For pages with non-200 codes, such as a 404, rendering might be skipped.

3. Indexing. Google parses the rendered HTML for more links and uses it to index the page.

Two details matter in practice:

Rendering isn't free. Every JavaScript file, API call and font has to be fetched. On large sites this affects how much Google crawls, which I cover in my crawl budget guide.

Rendering strategies compared: CSR, SSR, SSG, ISR and dynamic rendering

Two developers reviewing code together at one screen
Rendering decisions are made in code review, long before SEO sees them.

How your HTML is produced matters more than which framework you use. Here's how the main approaches compare for search.

Strategy What the first HTML contains SEO impact When to use it
Client-side rendering (CSR) An almost empty shell plus script tags. The browser builds the page. Highest risk. Google must render to see content. Non-rendering bots see little or nothing. Logged-in dashboards and app screens that don't need to rank.
Server-side rendering (SSR) Full HTML built on the server for each request, then hydrated. Strong. Content, links and meta tags are in the first response. Pages that change often or are personalised: listings, search pages, large catalogues.
Static site generation (SSG) / prerendering Full HTML built once at deploy time. Strong. Fast to serve and simple for every crawler. Blogs, docs, marketing pages, anything that changes rarely.
Incremental static regeneration (ISR) Static HTML that is rebuilt after deploy, on a schedule or on demand. Strong, as long as stale pages refresh quickly enough. Large sites with many pages that change sometimes, such as product pages.
Dynamic rendering Bots get prerendered HTML. Users get the client-side app. Works, but Google calls it a workaround. Two versions to maintain. Short-term fix for a legacy CSR app while you move to SSR or SSG.

On dynamic rendering, Google's own page is clear: it is "a workaround and not a recommended solution". Google recommends server-side rendering, static rendering or hydration instead. It's generally not treated as cloaking, as long as bots and users get similar content.

Hydration is what happens after SSR or SSG. The server sends full HTML, then JavaScript attaches event handlers so the page becomes interactive. That's good for crawlers. Heavy hydration can hurt responsiveness, which shows up as poor INP in Core Web Vitals.

Frameworks. Next.js (React) and Nuxt (Vue) support SSR, SSG and incremental rebuilds. Astro generates static HTML by default and only ships JavaScript for the interactive parts you mark. SvelteKit and Angular also support server rendering. I'm not recommending one. Each can produce SEO-friendly HTML if it's configured for server or static output.

Is a React site bad for SEO?

No. A React site that ships an empty <div id="root"> and builds everything in the browser is riskier for SEO. The same React code rendered on the server or at build time sends full HTML in the first response. The library isn't the issue. The rendering mode is.

Client-side vs server-side rendering for SEO

For pages you want found, server-side or static rendering is the safer default. Google can index CSR pages, but you add a render step that can be delayed or fail. You also lose crawlers that don't render. CSR is fine for screens behind a login.

JavaScript SEO best practices: how to do JavaScript SEO

Use real links with <a href>

Google's docs say Googlebot can only follow links that are <a> elements with an href attribute. Click handlers on other elements aren't crawled.

<span onclick="goTo('/pricing')">Pricing</span>
<a onclick="router.push('/features')">Features</a>
<a href="javascript:void(0)" data-url="/blog">Blog</a>
<a href="/pricing">Pricing</a>
<a href="/features">Features</a>

This is the most common JavaScript problem I find. It also hurts internal linking (proposed new page — confirm live), because pages linked only through scripts become orphans.

Use the History API, not fragments

Google says don't use URL fragments (#/products) to load different page content. Use the History API so every view has a real path.

// Client-side routing with real URLs
document.addEventListener('click', (event) => {
  const link = event.target.closest('a[data-spa]');
  if (!link) return;
  event.preventDefault();
  history.pushState({}, '', link.href); // /products/blue-shoes, not /#/products/blue-shoes
  renderRoute(location.pathname);
});

window.addEventListener('popstate', () => renderRoute(location.pathname));

The href stays a normal URL, so crawlers can follow it. Your server must also return the right page when someone requests /products/blue-shoes directly. Clean paths also help your SEO-friendly URL structure (proposed new page — confirm live).

Return meaningful status codes and avoid SPA soft 404s

An SPA often serves the same shell with a 200 for every URL, then shows "Page not found" with JavaScript. Google may treat that as a soft 404. Google's docs give two fixes: redirect to a URL where the server returns a real 404, or add noindex to the error page with JavaScript.

// Option 1: send missing items to a URL the server answers with HTTP 404
const res = await fetch(`/api/products/${slug}`);
if (res.status === 404) {
  window.location.href = '/not-found'; // server returns 404 for this URL
}

// Option 2: mark the error view as noindex
if (res.status === 404) {
  const meta = document.createElement('meta');
  meta.name = 'robots';
  meta.content = 'noindex';
  document.head.appendChild(meta);
}

If you use SSR, the better fix is to return a 404 status from the server for unknown routes.

Be careful with noindex, canonicals and titles set by JavaScript

JavaScript can set the <title> and meta description, and Google will use the rendered values. Robots and canonical tags have two traps:

My rule: put titles, canonicals and robots tags in the server response. Let JavaScript enhance the page, not decide whether it's indexed.

Structured data added with JavaScript

Google can read JSON-LD that JavaScript injects, and its docs say this is fine. Test it with the Rich Results Test, which shows the rendered result. If you're new to the markup, start with my schema markup guide.

Lazy loading and infinite scroll

Google's lazy-loading guidance says Google Search doesn't interact with your page. It won't scroll or click "Load more." Load content when it enters the viewport, using native loading="lazy" for images and iframes or the IntersectionObserver API. Don't lazy-load content that's visible on first load.

For infinite scroll, give each chunk a unique URL (for example ?page=3), link those pages in sequence, and update the address bar with the History API as the user scrolls.

Don't block what Google needs to render

If robots.txt blocks your JavaScript, CSS or API endpoints, Google can't render with them. Google also caches aggressively and may ignore caching headers, so it can run old files. Use fingerprinted file names like app.3f9a1c.js.

Other limits from Google's troubleshooting page:

Can AI crawlers like GPTBot render JavaScript?

Mostly no. In a December 2024 analysis of its network, Vercel found that none of the major AI crawlers it studied render JavaScript. That covered OpenAI, Anthropic, Meta, ByteDance and Perplexity bots. ChatGPT's and Claude's crawlers did fetch JavaScript files but didn't execute them. The exceptions were Gemini, which uses Googlebot's infrastructure, and AppleBot, which renders with a browser-based crawler.

That's a snapshot from one company's network, and crawlers can change. The practical point stands: if you want AI tools to read and cite a page, the content must be in the HTML response. I cover the AI crawler side, including the markdown question, in Markdown vs HTML for AI crawlers.

How to test JavaScript SEO: my workflow

Laptop showing a web page next to a browser developer tools panel
Compare the raw HTML with the rendered HTML to spot gaps.

I run this order on every JavaScript site, starting with the cheapest check.

  1. View source vs rendered DOM. Open view-source: for the URL and search for your H1, a key paragraph and an internal link. Then open DevTools > Elements, which shows the rendered DOM, and search again. Anything that's only in the second view depends on rendering.
  2. Disable JavaScript in the browser. In Chrome DevTools, open the Command Menu, run "Disable JavaScript" and reload. This shows roughly what a non-rendering crawler gets. Google removed its "test with JavaScript off" advice from the basics guide in March 2026 because Google renders JS. I still use it as a proxy for AI bots.
  3. URL Inspection in Search Console. Inspect the URL and open View crawled page to see the HTML Google indexed. Then run Test live URL and check the rendered HTML, the screenshot, and More info for page resources that couldn't load and JavaScript console messages.
  4. Rich Results Test. It shows the rendered HTML and confirms whether JSON-LD added by JavaScript is detected.
  5. Check the index. Search for a unique sentence from the JS-loaded content, in quotes, with site:yourdomain.com. If Google returns nothing after the page is indexed, the content probably wasn't in the rendered HTML.
  6. Crawl with rendering on. Use a crawler with JavaScript rendering on to compare raw and rendered titles, canonicals, links and word counts across the site.

If URL Inspection shows the page as crawled but not indexed or discovered but not indexed, check rendering before you blame content quality.

Common JavaScript SEO problems and fixes

Symptom Likely cause Fix
Rendered screenshot in URL Inspection is blank or partial JS error, blocked script or failed API call Check console messages and page resources in URL Inspection, unblock files in robots.txt, fix the error
Deep pages never discovered Navigation uses onclick or buttons, not <a href> Use real anchor links with crawlable URLs
Only the homepage is indexed Fragment routing (/#/page) Switch to History API routing with real paths
"Soft 404" in Search Console SPA returns 200 with a "not found" view Redirect to a URL returning 404, add noindex, or return 404 from the server
Page stays out of the index after removing noindex with JS noindex in raw HTML, so rendering is skipped Remove noindex from the server response
Wrong canonical chosen Raw and rendered canonicals differ Set one canonical in the server HTML
Products below the fold missing Content loads on scroll or "Load more" Load on viewport entry; give paginated chunks unique URLs
Old content in the rendered HTML Google using cached JS or CSS Fingerprint file names
Content missing in AI answers but fine in Google AI crawler doesn't execute JavaScript Move content into SSR or SSG output

JavaScript SEO checklist

Mobile matters too. Google indexes the mobile version, so run these checks on the mobile render. See mobile-first indexing (proposed new page — confirm live).

FAQ

What is the difference between JavaScript SEO and technical SEO?

Technical SEO covers everything that helps search engines crawl and index a site: status codes, sitemaps, robots.txt, speed and more. JavaScript SEO is the part that deals with content, links and tags that JavaScript produces or changes. On a plain HTML site, there's little JavaScript SEO to do.

Does Google index content that loads after a user clicks a tab?

It depends on how the tab works. If the tab content is already in the DOM and only hidden with CSS, Google can see it in the rendered HTML. If it's fetched only after a click, Googlebot won't see it, because it doesn't click.

Can Bing render JavaScript?

Bing said in a 2018 post that bingbot is generally able to render JavaScript, but that processing it at scale on every page is difficult. I don't rely on any crawler other than Googlebot to render. Server or static HTML covers all of them.

Is Google Tag Manager bad for SEO?

Using Tag Manager for analytics is fine. Using it to inject titles, canonicals, internal links or main content is risky. Those changes only exist after rendering, and they're easy to break without anyone noticing. Keep SEO-critical elements in the page template.

How long does Google take to render a JavaScript page?

Google's docs say pages may stay in the render queue for a few seconds, but it can take longer. There's no fixed timeline. If something matters for indexing, don't make it wait for the render step.

Do I need prerendering if I use Next.js?

Not usually. Next.js can render on the server or at build time already. Check the output. If a route is set to render only on the client, its first HTML will be nearly empty, and you're back to CSR. View source and confirm.

Sources

Akif Qureshi
Akif Qureshi
Senior SEO Specialist & Marketing Analyst | Content Strategist

Connect with Akif on LinkedIn, Instagram and Facebook.

2+ yrs in SEO Google & HubSpot certified 120+ guides

Driven by advanced SEO expertise, deep marketing analytics, high-impact content strategy

With 2+ years of hands-on SEO experience, I specialize in holistic search strategies that don’t just rank—they drive real, measurable business growth. I’ve worked across industries including healthcare, hospitality, legal, e-commerce, and professional services, helping brands dominate their target markets. My approach bridges the gap between raw data and creative execution. Every strategy I build is rooted in rigorous market analysis, structured SEO frameworks, and tailored content ecosystems—no templates, no shortcuts. Whether you’re a single-location brand or scaling across multiple cities, I create data-driven marketing systems designed to compound results and grow with you.

No sponsored content No affiliate links Reader supported

Is Your JavaScript Site Fully Indexed?

Get a rendering audit that shows what Google and AI crawlers actually see on your pages.

Book a Free SEO Audit →

Related guides

More SEO guides →

© 2026 Algoblueprints. All rights reserved.