Lesson 2 of 5 · 25 min

JavaScript Rendering and SEO

Make sure crawlers and AI tools see the same content users do.

XDQ Tutor · AI guide

Hello. In this lesson I will take you through 4 ideas, one at a time.

  1. The rendering problem
  2. Rendering choices
  3. Common JavaScript SEO mistakes
  4. Test like a crawler

Why it matters: Make sure crawlers and AI tools see the same content users do. After each idea I will ask you one quick question.

The rendering problem

The short version: Many modern sites build content in the browser with JavaScript.

Many modern sites build content in the browser with JavaScript. Search engines can render JavaScript, but rendering may be delayed and some crawlers, including many AI crawlers, read only the raw HTML. Content that appears only after scripts run can be missed.

Check the raw HTML of key pages: is the main content, title, links and structured data there before scripts run?

Quick check

Which rendering approach is safest for pages that must rank?

Rendering choices

The short version: Server-side rendering or static generation puts content in the initial HTML and is the safest choice for pages that must rank or be cited.

Server-side rendering or static generation puts content in the initial HTML and is the safest choice for pages that must rank or be cited. Client-side rendering suits logged-in app screens that should not be indexed anyway.

Hybrid frameworks let you render marketing pages on the server and app screens in the browser.

Quick check

Why are click-handler links a problem?

Common JavaScript SEO mistakes

The short version: Links built with click handlers instead of real anchor tags, content behind tabs that load on click, lazy-loaded text that never loads for crawlers, and titles set only by scripts.

Links built with click handlers instead of real anchor tags, content behind tabs that load on click, lazy-loaded text that never loads for crawlers, and titles set only by scripts. Each hides content or links from crawlers.

Use real links with href attributes and render important text in the HTML.

Quick check

How can you check what crawlers see?

Test like a crawler

The short version: Fetch pages with scripts disabled, use Search Console's URL inspection to see the rendered HTML, and compare.

Fetch pages with scripts disabled, use Search Console's URL inspection to see the rendered HTML, and compare. Automate a check in CI that key pages contain their main heading and text in raw HTML.

Repeat after framework upgrades.

Key takeaways
  • Many crawlers read only raw HTML
  • Render ranking pages on the server or statically
  • Use real anchor links and render key text in HTML
  • Test raw and rendered HTML in CI
Try it

Fetch your five most important pages with JavaScript disabled. List what is missing compared with the browser view and plan a fix for each.

That is the lesson.
Mark it complete to track your progress on this device.
← PreviousCrawling and Indexing: An Audit MethodNext lesson →Canonicals, Redirects and Structured Data