Book a Free Consultation

JavaScript SEO: Make Sure Google and AI Crawlers Can Read Your Site

TL;DR (Too Long; Didn't Read)

Google can render JavaScript, but it does so in a second step and only follows real links. Most AI crawlers, including the ones behind ChatGPT, Claude and Perplexity, do not run JavaScript at all. If your text, links or prices only appear after scripts run, put them in the HTML the server sends, using server-side rendering or static pages.

A code window with angle brackets beside two web pages, one complete and one empty with only a loading spinner

How Google Crawls, Renders and Indexes JavaScript

Google processes JavaScript pages in three stages: it crawls the HTML, queues the page for rendering in a recent version of Chrome, then indexes what the rendered page shows. Rendering can happen later than crawling. Content and links that exist only after scripts run are found later, and only if the scripts work for Googlebot.

Google describes the process in its JavaScript SEO basics. Two details matter for most business sites.

First, Googlebot does not click, scroll or type the way a person does. Text that appears only after someone presses "Read more", opens a tab that loads content on demand, or fills in a form may never be seen.

Second, Googlebot follows links only when they are real <a href="..."> elements. A button that changes the page through a click handler is not a link to Google, so the page behind it can become an orphan. Google's guide to crawlable links spells this out.

Why AI Crawlers Change the JavaScript Question

Most AI crawlers read only the HTML your server sends. Vercel's analysis of AI crawler traffic found that the crawlers from OpenAI, Anthropic, Perplexity, Meta and ByteDance did not render JavaScript. Google's Gemini uses Googlebot's rendering, so it is the exception. Content that needs JavaScript is invisible to most AI search tools.

The study, The rise of the AI crawler, looked at OAI-SearchBot, ChatGPT-User, GPTBot, ClaudeBot and PerplexityBot, among others. Some of them downloaded JavaScript files, but none executed them.

That changes the trade-off. A few years ago, a JavaScript-heavy site could rely on Google rendering it eventually. Now the same site may be readable by Google and blank to ChatGPT search. If you want to be cited in AI answers, the facts you want quoted (services, prices, locations, opening hours) need to be in the raw HTML.

Access is a separate question from rendering. Our guide to AI crawlers and robots.txt covers which bots to allow, and the ChatGPT search guide covers how those tools choose sources.

The Two-Minute Test: Is Your Content in the HTML?

Open your page, press Ctrl+U to view the source, and search for a sentence from the main content and a link from the menu. If you can find them, crawlers that skip JavaScript can read them. If the source shows little more than an empty div and script tags, your content depends on JavaScript.

  1. View source. Ctrl+U in Chrome shows the HTML the server sent, before any scripts run. This is what most AI crawlers see.
  2. Inspect the rendered page. Right-click and choose Inspect. The Elements panel shows the page after JavaScript. This is closer to what Google indexes.
  3. Compare the two. Text, prices, product lists or links that exist in Inspect but not in View source are JavaScript-dependent.
  4. Check Google's view. In Search Console, run URL Inspection, then View crawled page or Test live URL. The rendered HTML and screenshot show what Googlebot got.

Run the test on your homepage, one service or product page and one blog post. Templates usually share the same problem, so three pages tell you most of the story.

Common JavaScript SEO Problems

The common problems are links built as buttons, content that loads only after a click or scroll, pages rendered entirely in the browser, JavaScript or CSS blocked in robots.txt, titles and canonicals added by scripts, and error states that return a 200 status. Each one hides content or sends Google mixed signals.

  • Links as buttons or spans. Menus and "view product" buttons with onclick handlers and no href do not pass Google a URL.
  • Content behind interactions. Reviews, specifications or FAQs that load only when a visitor clicks a tab.
  • Client-side-only rendering. Single-page apps that send an empty shell and build every page in the browser.
  • Blocked resources. A Disallow: /js/ or /wp-includes/ line in robots.txt can stop Google rendering the page properly.
  • Head tags written by scripts. Titles, meta descriptions and canonical tags that JavaScript changes after load. Google may process the original value, and AI crawlers only see the original.
  • Soft 404s. An app that shows "product not found" but returns a 200 status code. Google may index the error page.
  • Infinite scroll with no paginated URLs. Products further down the list have no address Google can request.

How to Fix JavaScript SEO Problems

Send the important content and links in the first HTML response. The cleanest ways are server-side rendering, where the server builds each page on request, and static generation, where pages are built ahead of time. Use real anchor links, keep head tags in the server HTML, and return proper status codes for missing pages.

ApproachWhat the crawler receivesGood for
Client-side rendering onlyAn empty shell plus scriptsLogged-in dashboards and tools that should not rank
Server-side rendering (SSR)Full HTML for each requestStores and sites with frequently changing content
Static site generation (SSG)Full HTML built in advanceService sites, blogs and landing pages
Hydration on top of SSR or SSGFull HTML, then interactivity addedMost modern frameworks, such as Next.js, Nuxt and Astro

Smaller fixes help too. Replace click-only navigation with <a href> links. Load tab content into the HTML and hide it with CSS rather than fetching it on click. Give each infinite-scroll batch its own paginated URL. Remove robots.txt rules that block script and style files. Then re-run the two-minute test.

Speed is part of the same work. Heavy scripts slow pages on the mid-range phones and patchy mobile connections many South African visitors use. Our Core Web Vitals guide covers INP, the metric most affected by JavaScript.

What This Means for WordPress, Wix, Shopify and React Sites

WordPress, Wix and Shopify send server-rendered HTML for normal pages, so the base content is usually readable. Problems come from add-ons: sliders, tab widgets, review apps and page builders that load content by script. Single-page React or Vue apps without server-side rendering carry the highest risk and need the fixes above.

  • WordPress. Core pages are built on the server. Check page-builder tabs, accordion plugins and review widgets with the two-minute test.
  • Wix. Pages are rendered on Wix's servers. Watch content added through embedded custom code or third-party apps.
  • Shopify. Themes render on the server. Review and upsell apps often inject their content with JavaScript, so reviews may not be in the HTML.
  • React, Vue or Angular apps. A plain single-page app sends an empty shell. Use a framework with SSR or SSG, such as Next.js or Nuxt, for any page that should rank or be cited.

Planning a rebuild? Decide the rendering approach before design starts, and keep the old URLs mapped. Our website migration SEO guide covers the redirect side, and the technical SEO guide covers the rest of the stack.

Frequently Asked Questions

Can Google read JavaScript content?

Yes. Google renders pages in a recent version of Chrome and indexes the rendered result. Rendering can happen after the first crawl, Googlebot does not click or scroll like a person, and it only follows real anchor links, so content behind interactions may still be missed.

Do ChatGPT and other AI crawlers run JavaScript?

Mostly not. Vercel's analysis of AI crawler traffic found that crawlers from OpenAI, Anthropic, Perplexity, Meta and ByteDance did not execute JavaScript. Gemini uses Google's rendering. Put the content you want AI tools to quote in the HTML your server sends.

How do I check if my content depends on JavaScript?

Press Ctrl+U to view the page source and search for a sentence from the main content. If it is missing from the source but visible on the page, it depends on JavaScript. In Search Console, URL Inspection shows the rendered HTML Googlebot received.

Is a React website bad for SEO?

Not if it renders on the server. A React site built with server-side rendering or static generation, for example through Next.js, sends full HTML. A plain single-page React app that builds everything in the browser is the risky setup.

Should I block JavaScript files in robots.txt?

No. Google needs your script and style files to render pages correctly. Blocking them can make Google see a broken or empty page. Remove any robots.txt rules that disallow JavaScript or CSS folders.

Find Out What Crawlers Actually See

A technical SEO audit compares your server HTML with the rendered page across your templates and lists exactly what to fix. Book a free consultation and we will reply within 1 business day.

Book a Free Consultation →