Skip to content
Make your website fast and easy to find

Lesson 5 of 6

JavaScript SEO & rendering

7 min read

The rendering problem

If your content only appears after JavaScript runs, search engines must render the page to see it — an expensive, sometimes-delayed second pass. Get it wrong and engines index a blank shell, or your content shows up days late (or not at all). AI crawlers are even less likely to execute JS.

Rendering strategies

  • SSR (server-side rendering) or SSG (static generation) — the HTML arrives with content already in it. Best for SEO. (Frameworks like Next.js do this.)
  • Client-side rendering only — riskiest for SEO; the page is empty until JS runs.
  • Dynamic rendering — a legacy stopgap; prefer SSR/SSG.

Practical rules

  • Make sure critical content and links are in the initial HTML (view source, not just the rendered DOM).
  • Don't hide primary content behind clicks/tabs that require JS to load it.
  • Use real anchor-tag links (with an href), not JS-only click handlers, so crawlers can follow them.
  • Test with Search Console's URL Inspection ("View crawled page") to see what Google actually got.

The takeaway

JavaScript is fine — but the content and links that matter for SEO should reach the crawler in the HTML. When in doubt, render on the server.

You can read every lesson for free — no account needed. To save your progress and earn a certificate, you'll need a free account. Create one or sign in whenever you're ready — you won't lose your place.

Saving your progress needs a free account — we'll ask you to sign in.