SEO & Speed Optimization

JavaScript SEO: How to Make React, Next.js and JS-Heavy Sites Rank

Websites built with React and other JavaScript frameworks can rank well, or be nearly invisible. Here's how JavaScript SEO works and how to get it right.

In this article · 7 sections
  1. How Google handles JavaScript
  2. Rendering approaches
  3. Common JavaScript SEO problems
  4. How to check your site
  5. Fixes
  6. Is plain PHP better for SEO?
  7. FAQs
  8. Can Google index React websites?
  9. Do AI search tools read JavaScript content?

Modern websites and web apps are often built with React, Vue, Angular or similar frameworks. They feel fast and app-like, but they can create SEO problems if content only appears after JavaScript runs. JavaScript SEO is about making sure search engines and AI crawlers can see your content, links and metadata.

How Google handles JavaScript

Google crawls the HTML first, then renders the page with a headless Chrome to run JavaScript, often after a delay. Content that appears only after rendering can still be indexed, but: - Rendering takes resources and time - Errors or blocked scripts can hide content - Many other crawlers (including some AI crawlers and social preview bots) don't run JavaScript at all

Rendering approaches

Approach How it works SEO
CSR (client-side rendering) Browser builds the page with JS Risky: initial HTML is nearly empty
SSR (server-side rendering) Server sends full HTML; JS hydrates it Strong
SSG (static generation) HTML built at deploy time Strong and fast
ISR / hybrid Static pages updated periodically Strong

Frameworks like Next.js, Nuxt, Remix and Astro make SSR/SSG straightforward. For marketing pages, blogs and product pages, prefer SSR or SSG.

Common JavaScript SEO problems

  1. Empty initial HTML: "View source" shows only <div id="root"></div>
  2. Links that aren't links: onClick navigation without <a href> means crawlers can't follow
  3. Metadata set late: titles and meta descriptions added by JS after load
  4. Hash URLs (/#/services): fragments generally aren't treated as separate pages
  5. Blocked resources: robots.txt blocking JS/CSS files
  6. Content behind interactions: text that loads only after clicking tabs or scrolling
  7. Soft 404s: non-existent routes return 200 with a "not found" message
  8. Heavy bundles: slow rendering and poor Core Web Vitals

How to check your site

  • View page source: is your main content in the raw HTML?
  • Search Console → URL Inspection → View crawled page: see rendered HTML and screenshot
  • Rich Results Test: shows rendered HTML too
  • Disable JavaScript in the browser and see what's left

Fixes

  • Use SSR or SSG for indexable pages
  • Real <a href="/page"> links for navigation
  • Server-render titles, meta descriptions, canonicals and structured data
  • Return proper 404 status codes for missing routes
  • Lazy-load below-the-fold components, not main content
  • Split JavaScript bundles; reduce third-party scripts. See third-party scripts

Is plain PHP better for SEO?

Server-rendered PHP or WordPress sites send full HTML by default, so they avoid most JavaScript SEO problems. For typical business websites, a well-built server-rendered site is simpler and very SEO-friendly. Use JS frameworks where interactivity justifies them.

FAQs

Can Google index React websites?

Yes, but SSR/SSG makes indexing faster and more reliable.

Do AI search tools read JavaScript content?

Many AI crawlers fetch raw HTML and may not run JavaScript. Server-rendered content is safer for AI visibility. See AI crawlers and robots.txt.

Joboo Web builds server-rendered, SEO-friendly websites. Ask for a JavaScript SEO check.

Share this article

Joboo Web

Web design, SEO & digital marketing team · Ludhiana, Punjab

Joboo Web has helped Indian businesses grow online since 2019 — building fast websites and running SEO, Google Ads and social campaigns for clients in 80+ cities. About us →

Keep reading

💬