Skip to content
Searchpedia SEO field notes Callum Bennett Callum

Site ops

JavaScript SEO

Google can render JavaScript, but if your content isn't in the initial HTML you're gambling with indexing speed and reliability.

Beginner5 min readUpdated 2026-07-27Notes by Callum Bennett

Start here

  • Use your browser's view source to check if main content, title, and meta description exist in the initial HTML, not just in a JavaScript bundle.
  • Run the URL Inspection tool in Google Search Console on your most important pages and compare the rendered HTML to what you see in a browser.
  • If you rely on client-side rendering, implement server-side rendering or pre-rendering for critical pages to eliminate the rendering delay for Google.
  • Ensure all internal links use real <a> tags with href attributes, not JavaScript event handlers that Google might miss.

Plain-English take

JavaScript SEO is not about avoiding JavaScript. It is about being honest with yourself about how Google sees your site. Google can run JavaScript, but it is not as fast or perfect as your browser. If your entire page is built in JavaScript (client-side rendering), there is a delay: Google has to crawl the initial HTML, then queue your page for rendering, which can take days. If the JavaScript fails or times out, Google sees a blank page. I have seen this happen on an Angular site that dropped from rankings overnight. The fix was moving core content into the initial HTML, which meant switching to server-side rendering for the most important pages. The plain truth is: if your page source (Ctrl+U) does not contain your main heading and paragraph text, you have a JavaScript SEO problem. Test this before you do anything else. Use the URL Inspection tool in [Technical SEO](/technical-seo/) audits to verify what Google actually renders.

When it actually matters

JavaScript SEO matters whenever key content, links, or metadata depend on JavaScript executing correctly. This includes single-page apps built with frameworks like React, Angular, or Vue, sites that load content via AJAX, and pages that use lazy loading for main content. It also matters for structured data: if you inject [Schema Markup](/schema-markup/) via JavaScript, it must be present in the rendered DOM for Google to use it. I worked on a PWA that generated all internal links through JavaScript event handlers. Google could not follow them. The fix was to add real <a> tags with href attributes, which is a core requirement for crawlable links. Client-side rendering is simpler to develop but riskier for SEO. Server-side rendering adds complexity and server cost but ensures Google sees your content immediately. I recommend pre-rendering for content-heavy pages and dynamic rendering for user-specific content, but always test with the [SEO Audit](/seo-audit/) tools first. For simple brochure sites with static HTML, JavaScript SEO is rarely a priority.

What I got wrong

Early in my career, I blocked JavaScript and CSS in robots.txt thinking it would speed up crawling. I was wrong. Google needed those files to render the page, and I ended up with a site that looked like a blank white page to Google. It took me weeks to realise my mistake. Another error: assuming that if the page looked right in my browser, Google saw the same thing. It does not. Browsers are far more forgiving than Google's web renderer. I once had a site that loaded content via AJAX after a user interaction; I thought Google would trigger that, but it never did. Now I always run the URL Inspection tool in Search Console and compare the rendered HTML to the page source. I also learned that lazy loading is not a free pass. If you lazy load the main content, Google may never see it. Follow Google's guidance: ensure important content is in the initial HTML or at least in the first few scrolls. I now test every new framework change with [Mobile SEO](/mobile-seo/) checks to be certain.

Next step

Quick answers

Does Google execute all JavaScript on a page?

No. Google executes JavaScript, but it may defer or skip scripts that are too heavy, timeout after a few seconds, or ignore scripts that require user interaction. Critical content should not rely on JavaScript execution.

Should I use server-side rendering for all pages?

Not necessarily. Server-side rendering adds server cost and complexity. Reserve it for pages where organic traffic matters most, such as landing pages and product pages. Pre-rendering is a lighter alternative for less critical pages.

How do I test if Google can see my JavaScript content?

Use the URL Inspection tool in Google Search Console. Click 'View Crawled Page' to see the rendered HTML. Compare it to the page source (Ctrl+U in your browser). If they differ significantly, you have a JavaScript SEO issue.

Sources

Primary documentation is linked directly. Anything commercial is marked nofollow.

Notes from Callum Bennett.