Why JavaScript creates SEO risk#
Google can execute JavaScript, but rendering happens in a separate step after crawling and uses more resources. If important content, links or meta tags only appear after scripts run — or after a user clicks — search engines may index an incomplete page. Many other crawlers, including some AI crawlers and social preview bots, don’t execute JavaScript at all.
Rendering approaches#
| Approach | SEO | Notes |
|---|---|---|
| Server-side rendering (SSR) | Excellent | HTML arrives complete; Next.js, Nuxt, SvelteKit, Remix |
| Static generation (SSG) | Excellent | Pre-built HTML; great for blogs and marketing pages |
| Client-side rendering (CSR) | Risky | Empty HTML shell until JS runs |
| Dynamic rendering | Workaround | Google no longer recommends it as a long-term solution |
Checklist#
- Use real
<a href="/path/">links — notonclickhandlers or#routes. - Give every view its own crawlable URL; avoid hash (#) routing for content.
- Render title, meta description, canonical and structured data in the initial HTML.
- Don’t block JS and CSS files in robots.txt.
- Return proper status codes (a 404 view should return 404, not 200).
- Test with Search Console URL Inspection → “View crawled page” and compare with what users see.
Full guide: JavaScript SEO guide. Related: Googlebot, soft 404.