JavaScript Rendering and SEO
Make sure crawlers and AI tools see the same content users do.
Hello. In this lesson I will take you through 4 ideas, one at a time.
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.
In this lessonFollows you as you read
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?
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.
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.
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.
- 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
Fetch your five most important pages with JavaScript disabled. List what is missing compared with the browser view and plan a fix for each.
Mark it complete to track your progress on this device.