In this article · 7 sections
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
- Empty initial HTML: "View source" shows only
<div id="root"></div> - Links that aren't links:
onClicknavigation without<a href>means crawlers can't follow - Metadata set late: titles and meta descriptions added by JS after load
- Hash URLs (
/#/services): fragments generally aren't treated as separate pages - Blocked resources: robots.txt blocking JS/CSS files
- Content behind interactions: text that loads only after clicking tabs or scrolling
- Soft 404s: non-existent routes return 200 with a "not found" message
- 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.