Skip to content
24/7 support · 7-day money-back guarantee · Free plan, no card neededSee plans

Blog › Technical SEO ›

JavaScript SEO for the AI era: make sure Google, Bing and AI crawlers can actually read your pages

Cover image: JavaScript SEO for the AI era: make sure Google, Bing and AI crawlers can actually read your pages

Modern websites lean heavily on JavaScript. Frameworks render content in the browser, components load data after the page appears, and interactive features depend on scripts. For users with modern browsers, this usually works well. For search engines and AI systems, it can create problems. Content that only appears after JavaScript runs may be indexed late, partially or not at all, depending on the crawler.

Contents of the guide: JavaScript SEO for the AI era: make sure Google, Bing and AI crawlers can actually read your pages
The main sections of this guide.

Google has invested heavily in rendering JavaScript, and Googlebot uses a recent version of Chromium to render pages. Even so, rendering happens in a queue after crawling, can be delayed and can fail when scripts error or resources are blocked. Many other crawlers, including several used by AI assistants and smaller search engines, do not execute JavaScript fully or at all. Google’s guidance on AI search reminds site owners to follow JavaScript SEO best practices, because AI features rely on the same index as classic search.

This guide explains how crawlers process JavaScript, why AI crawlers raise the stakes, how to test what crawlers see, which rendering strategies work best and the common mistakes that hide content from search.

How Google processes JavaScript

Google processes JavaScript pages in three main stages: crawling, rendering and indexing. First, Googlebot fetches the URL and reads the initial HTML. It can extract links and content present in that HTML immediately. Then the page enters a render queue, where a headless Chromium browser executes JavaScript and produces the rendered HTML. Finally, Google indexes the rendered content and follows links found in it.

Rendering usually happens quickly, but it can be delayed, and it consumes resources. If scripts fail, take too long, depend on user interaction or require blocked resources, content may not appear in the rendered version. Content that requires scrolling, clicking or logging in to appear is generally not seen.

Google’s documentation encourages server-side rendering, static rendering or hydration for important content, while noting that client-side rendering can work if implemented carefully.

Comparison: Rendering approaches and who can read them
Rendering approaches and who can read them

Why AI crawlers raise the stakes

AI assistants that search the web often use their own crawlers or partner indexes. Many of these crawlers fetch HTML without executing JavaScript, or execute it only partially, to keep costs down at large scale. If your important content is rendered client-side, these crawlers may see an almost empty page: a few navigation links, a loading spinner and a script tag.

The consequence is that a page can rank well in Google, where rendering eventually happens, but be invisible to AI assistants that rely on other crawlers. That means no citations, no referrals and potentially inaccurate descriptions of your business, because the assistant could not read your pages.

Bing also renders JavaScript, but rendering capabilities and timing differ between search engines. Assume that the less your content depends on JavaScript to appear, the more widely it will be understood.

Testing what crawlers see

The first step is to compare the raw HTML with the rendered page. In a browser, use the view source option to see the HTML as delivered by the server, before JavaScript runs. Search it for your main headings, body text, prices and links. If they are missing, they depend on JavaScript.

Google’s URL Inspection tool in Search Console shows the rendered HTML Googlebot produced and a screenshot, along with any resources that could not be loaded. Use the live test to check current versions. The Rich Results Test also shows rendered HTML.

For a crawler that does not execute JavaScript, fetch the page with a command-line tool or a simple fetch utility and inspect the response. What you see there is roughly what many AI crawlers see.

Run a site audit to identify pages where titles, descriptions, headings or content appear thin, which can indicate rendering issues.

Rendering strategies

Server-side rendering (SSR). The server generates full HTML for each request, including content, and sends it to the browser. JavaScript then adds interactivity. Crawlers receive complete content immediately. Most modern frameworks support SSR.

Static site generation (SSG). Pages are pre-built as HTML at build time and served as static files. This is fast and crawler-friendly, suitable for content that does not change per request.

Incremental or on-demand static generation. Pages are generated statically and refreshed periodically or on demand, combining speed with freshness.

Hydration. Server-rendered HTML is enhanced with JavaScript in the browser to become interactive. Content is visible to crawlers from the start.

Client-side rendering (CSR). The server sends a minimal HTML shell, and JavaScript builds the content in the browser. This is the riskiest approach for search and AI visibility.

Dynamic rendering. Serving pre-rendered HTML to bots and client-side pages to users was once recommended as a workaround but Google now describes it as a workaround rather than a long-term solution, recommending SSR, static rendering or hydration instead.

For most content-driven sites, SSR or static generation for important pages is the safest choice.

Step by step: Checking JavaScript visibility in 15 minutes
Checking JavaScript visibility in 15 minutes

Critical elements that must be in the HTML

Some elements are especially important to include in the initial HTML response. Title tags and meta descriptions should be present without JavaScript. Canonical tags and robots directives should be in the HTML, not injected by scripts, since conflicting or late changes can cause problems. Main headings and body content should be server-rendered. Internal links should be standard anchor elements with href attributes, not click handlers on other elements. Structured data should ideally be in the initial HTML. Images that matter should use standard image elements with src attributes.

If JavaScript changes any of these after load, crawlers may see conflicting signals. For example, a page that has a noindex tag in its HTML and removes it with JavaScript may never be indexed, because Google may skip rendering for pages marked noindex.

Links and navigation

Search engines discover pages by following links. Links must be real anchor elements with href attributes pointing to URLs. Navigation built with buttons or elements that change the page with JavaScript, without real URLs, can prevent crawlers from discovering content.

Single-page applications should use the History API to give each view a distinct URL and render content for that URL on the server or at build time. Avoid using fragments, the part of a URL after a hash, to represent different pages, since search engines typically ignore fragments.

Lazy loading and infinite scroll

Lazy loading content as users scroll can hide it from crawlers that do not scroll. For images, use native lazy loading with proper src attributes so crawlers can discover them. For content lists, such as blog archives or product listings, provide paginated URLs with links so crawlers can reach all items. Infinite scroll should be backed by paginated URLs that load the same content.

Errors and blocked resources

JavaScript errors can break rendering. A script that fails to load, a dependency that is blocked by robots.txt or an API that times out can leave the rendered page empty. Monitor errors in the browser console and in the URL Inspection tool’s resources list. Make sure robots.txt does not block JavaScript, CSS or API endpoints needed to render content. Check your robots.txt rules after any changes.

Performance and JavaScript

Heavy JavaScript also affects Core Web Vitals, especially Interaction to Next Paint and Largest Contentful Paint. Reducing JavaScript, splitting bundles, deferring non-critical scripts and rendering content on the server improve both crawlability and user experience. These goals align.

WordPress and JavaScript SEO

Traditional WordPress themes render content on the server with PHP, so most WordPress pages are crawler-friendly by default. Problems arise with certain plugins and builders that load content through JavaScript, headless WordPress setups with client-side front ends, and features such as tabs, accordions and sliders that render content with scripts.

If you use a headless setup with a JavaScript framework, make sure the front end uses SSR or static generation. If you use plugins that load content dynamically, check the raw HTML of affected pages. Content in tabs and accordions is usually fine if it is present in the HTML and hidden with CSS, but problematic if it is fetched only when a tab is clicked.

Common mistakes

Building entire sites with client-side rendering and assuming Google will handle it. Injecting canonical tags or robots directives with JavaScript. Using buttons instead of links for navigation. Relying on infinite scroll without paginated URLs. Blocking script or API resources in robots.txt. Ignoring JavaScript errors that break rendering. Testing only in a logged-in browser that hides problems.

Understanding the render budget

Rendering JavaScript costs search engines computing resources. Google has said it renders pages at scale, but heavy pages that require many scripts, large bundles and numerous API calls take longer and are more likely to time out or render incompletely. Pages that render quickly and simply are processed more reliably. This is another reason to keep JavaScript lean and to render important content on the server: it reduces dependence on the search engine’s willingness and ability to spend resources on your page.

For very large sites, rendering delays can mean that new or updated content takes longer to appear in search. If timely indexing matters, such as for news, events or product launches, server-rendered content offers a clear advantage.

Structured data and JavaScript

Structured data can be injected with JavaScript, and Google can read it after rendering. However, injected markup is subject to the same rendering risks as other content, and crawlers that do not execute JavaScript will not see it. If structured data matters for your pages, such as product markup on a shop, include it in the server-rendered HTML. After implementation, check with the schema checker that the markup appears in the HTML response and validates correctly.

Personalization and A/B testing

Personalization and A/B testing tools often use JavaScript to change content after load. If these tools modify headings, text or links significantly, crawlers may see different content depending on whether they render JavaScript and which variant they receive. Google allows A/B testing but warns against cloaking, which means showing search engines content materially different from what users see.

Keep tests limited in time, use canonical tags appropriately for variant URLs and avoid tests that change core content for crawlers in ways users would not see. Make sure the default content in the HTML is complete and representative.

Monitoring JavaScript SEO over time

JavaScript issues often appear after deployments. A new framework version, a changed build configuration or a new third-party script can break rendering without anyone noticing. Add checks to your release process: after deploying, fetch key pages without JavaScript and confirm that titles, headings and main content are present; run URL Inspection on representative pages; and watch Search Console’s indexing reports for sudden increases in excluded or crawled-but-not-indexed pages.

Automated monitoring tools can alert you when pages change unexpectedly, such as titles disappearing or content length dropping sharply.

Working with developers

JavaScript SEO requires collaboration between SEO specialists and developers. Share clear requirements: which elements must be server-rendered, how links must be implemented, which resources must not be blocked and how to test. Provide examples of correct and incorrect implementations. Involve SEO early in decisions about frameworks and rendering strategies, since changing approaches later is expensive. Developers generally respond well to concrete, testable requirements rather than vague requests to “make it SEO friendly.”

Progressive enhancement as a principle

Progressive enhancement means building pages that work with basic HTML first, then adding JavaScript to improve interactivity. Content and navigation are available to every visitor and crawler, while scripts enhance the experience for those who can run them. This approach naturally solves most JavaScript SEO problems and also improves accessibility and resilience, since pages still work when scripts fail or load slowly.

Framework-specific notes

Most popular JavaScript frameworks now offer server-side rendering or static generation, but defaults and configurations vary.

React-based sites can use meta-frameworks that support server rendering and static generation for routes. Purely client-rendered React applications built without such tooling usually deliver an empty shell to crawlers. If you use React, confirm which rendering mode each route uses and prefer server or static rendering for public content.

Vue-based sites have similar options through meta-frameworks that render on the server or generate static pages. Single-page Vue applications without server rendering face the same risks as client-rendered React apps.

Angular supports server-side rendering through its own tooling. Check that public routes are pre-rendered or server-rendered.

Svelte and similar frameworks often encourage server rendering by default through their application frameworks, which is helpful, but confirm the configuration for each route.

Whatever the framework, the testing method is the same: fetch pages without JavaScript and inspect the HTML. If the main content is missing, adjust the rendering strategy for those routes.

Headless CMS setups

Headless architectures separate the content management system, such as WordPress or another CMS, from the front end, which is often built with a JavaScript framework. This offers flexibility and performance but moves SEO responsibility to the front end. Titles, descriptions, canonical tags, structured data, sitemaps, redirects and robots directives that a traditional CMS theme or SEO plugin would output must be implemented in the front end.

When planning a headless project, list every SEO element the current site outputs and make sure the new front end reproduces them, ideally pulling values from the CMS so editors can manage them. Build sitemaps that reflect the front-end URLs. Implement redirects at the front end or edge. Test thoroughly before launch, and compare crawls of the old and new sites.

Common symptoms of rendering problems

Several symptoms suggest that JavaScript is causing indexing issues. Pages appear in search with titles or descriptions that do not match what users see. Search Console reports many pages as crawled but not indexed or as duplicates without a clear reason. Site searches show indexed pages with little or no content in snippets. New pages take much longer to be indexed than expected. AI assistants describe your pages vaguely or not at all. If you see these symptoms, inspect affected URLs, compare raw and rendered HTML and check for script errors and blocked resources.

Content behind interactions

Some content only appears after a user action: clicking a “load more” button, opening a modal, selecting a tab that fetches data or completing a form. Crawlers generally do not perform these actions. If such content matters for search, make it available in the initial HTML or through crawlable links to separate URLs. For example, instead of loading product reviews only when a tab is clicked, include a selection of reviews in the HTML and link to a full reviews page.

Accessibility overlap

Many practices that help crawlers also help users of assistive technologies. Real links, semantic HTML, server-rendered content and progressive enhancement make pages more accessible. Screen readers, like some crawlers, struggle with content that depends on complex scripts and non-standard controls. Improving JavaScript SEO often improves accessibility at the same time, and vice versa.

A short checklist for developers

  1. Render titles, meta descriptions, canonical tags and robots directives on the server.
  2. Render main headings and body content in the initial HTML.
  3. Use anchor elements with href attributes for all navigation and internal links.
  4. Give every view its own URL without relying on hash fragments.
  5. Provide paginated URLs behind infinite scroll and load-more buttons.
  6. Include structured data in the server-rendered HTML.
  7. Keep scripts, styles and API endpoints needed for rendering unblocked.
  8. Test each release by fetching key pages without JavaScript.

Measuring success

After fixing rendering issues, track the results. Watch indexing reports in Search Console for improvements in indexed pages. Monitor how quickly new pages appear in search. Check server logs for AI crawlers retrieving full pages. Sample AI assistant answers to see whether your pages are cited and described accurately. Compare organic traffic and conversions for affected sections before and after the change.

The simple rule

If a piece of content matters for search, it should be in the HTML your server sends, before any script runs. Everything else in JavaScript SEO is a refinement of that rule.

Revisit after every rebuild

Every redesign or framework upgrade is a chance for rendering problems to return. Make the no-JavaScript fetch test a permanent part of your launch checklist.

Key takeaways

  • Google renders JavaScript, but rendering can be delayed or fail.
  • Many AI crawlers do not execute JavaScript fully, so client-side content may be invisible to them.
  • Compare raw HTML with rendered output to see what crawlers receive.
  • Prefer server-side rendering, static generation or hydration for important content.
  • Keep titles, canonicals, robots directives, headings, content and links in the initial HTML.
  • Use real links, paginated URLs and unblocked resources.

Frequently asked questions

Does Google index JavaScript content? Yes, usually after rendering, but delays and failures can occur.

Do AI crawlers run JavaScript? Many do not or do so only partially. Assume that server-rendered content is more widely visible.

Is client-side rendering bad for SEO? It is riskier. It can work for Google if carefully implemented, but it limits visibility elsewhere.

Is dynamic rendering still recommended? Google describes it as a workaround and recommends SSR, static rendering or hydration instead.

Are tabs and accordions bad? Not if content is in the HTML. They are a problem if content loads only on click.

How do I test what AI crawlers see? Fetch the page without JavaScript and inspect the response; that approximates many AI crawlers.

A worked example

A software company rebuilt its marketing site with a JavaScript framework using client-side rendering. Google traffic dipped briefly and recovered, but the company noticed that AI assistants described its product inaccurately and rarely cited its pages. A fetch without JavaScript showed that its pages contained only a navigation shell and a loading message; product descriptions, pricing and documentation were all rendered client-side.

The company switched to the framework’s server-side rendering mode for marketing and documentation pages. Titles, descriptions, canonical tags and structured data were moved into the server-rendered HTML. Navigation was rebuilt with real links. Within weeks, server logs showed AI crawlers retrieving full content, and sampled AI answers began citing the documentation and describing pricing correctly. Google indexing became faster for new pages as well.

Keep reading

Comments

Leave a comment

Check your own site

Run a free audit and see what to fix first.

Run a free audit