JavaScript SEO

JavaScript SEO is the practice of making sure content and links generated or changed by JavaScript can be crawled, rendered and indexed by search engines. It matters even more now that many AI crawlers do not run JavaScript at all.

Many modern sites are built with JavaScript frameworks such as React, Vue or Angular. Content may be loaded after the page opens, links may be generated by scripts, and in some setups the initial HTML is almost empty. JavaScript SEO is about making sure search engines still see what users see.

How Google handles JavaScript. Google processes pages in three steps: crawling, rendering and indexing. After fetching the HTML, it puts pages in a queue for its Web Rendering Service, which runs an up-to-date version of Chromium to execute the JavaScript and build the final page. Rendering usually happens quickly, but it costs Google resources and things can go wrong along the way: blocked scripts, timeouts, errors or content that only loads after a user action.

Other crawlers are less patient. Bing renders JavaScript too, but many AI crawlers and social media preview bots read only the raw HTML. If your main content is injected by JavaScript, those systems may see an empty page, which hurts your chance of being quoted in AI answers or shown properly when shared.

Rendering approaches:

  • Client-side rendering (CSR): the browser builds the page. Riskiest for SEO and AI visibility.
  • Server-side rendering (SSR): the server sends complete HTML, which the JavaScript then makes interactive. The safest default for content that should rank.
  • Static generation: pages are built as HTML in advance. Fast and very crawlable.
  • Dynamic rendering: serving pre-rendered HTML to bots only. Google describes this as a workaround and no longer recommends it.

Common problems:

  • Links built as buttons or elements with click handlers instead of anchor elements with an href. Google only follows real links.
  • Content that loads only on scroll, click or after a delay.
  • Routing with hash fragments (#/page), which Google treats as the same URL.
  • Meta titles, canonicals or noindex tags that are changed by JavaScript, which can send mixed signals. If the raw HTML says noindex, Google may never render the page at all.
  • Blocking JavaScript or API endpoints in robots.txt, so Google cannot render the content.
  • Soft 404s, where a missing page still returns 200 because the app shows its own error screen.

How to test. Compare the raw HTML (view source) with the rendered HTML (Inspect element). The URL Inspection tool in Google Search Console shows the rendered HTML Google saw and any resources it could not load. Searching for a sentence from your JavaScript-loaded content on Google is a quick sanity check. For AI crawlers, fetching the page without JavaScript, for example with a command line request, shows roughly what they get.

The safest rule: put the content and links that matter in the initial HTML, and use JavaScript to enhance the page rather than to build it.

Questions about JavaScript SEO

Can Google index JavaScript content?

Yes. Google renders pages with a recent version of Chromium, but it takes extra steps and can fail on errors, blocked resources or content that waits for user actions.

Do AI crawlers render JavaScript?

Many do not. They read only the initial HTML, so content injected by JavaScript may be invisible to them. Server-side rendering avoids this.

Is dynamic rendering still recommended?

No. Google now calls it a workaround and recommends server-side rendering, static generation or hydration instead.

Related terms