JavaScript SEO: How Google and AI Crawlers See Your Site
JavaScript SEO makes sure crawlers can see the content and links your scripts build. Here's how Google renders JS, which rendering mode to pick, the common failures and why many AI bots never run it.
JavaScript SEO is the work of making sure search engines and AI crawlers can see the content and links your scripts build. Google can run JavaScript, but it renders pages in a second step that can lag. Many AI crawlers don't run it at all. The safe default is simple: send the content that matters in the first HTML response.
Most JavaScript SEO problems aren't exotic. A product page loads its copy after an API call. A nav menu uses buttons instead of links. A robots.txt rule blocks the bundle that builds the page. Google sees a shell. The team sees a beautiful site.
This guide covers how Google crawls and renders JavaScript, the rendering modes and which to pick, why AI crawlers are a different story, the common failures, how to test with URL Inspection, a worked example and a one-week plan.
Key takeaways
- Google renders in a second pass. Content in the first HTML gets indexed sooner and more reliably.
- Server or static rendering is the default. Google recommends it over workarounds.
- Many AI crawlers read only raw HTML. If your copy needs JavaScript, they may never see it.
- Links need an href. Buttons and onClick handlers aren't crawlable links.
- Test the rendered page, not your browser. URL Inspection shows what Google actually got.
How does Google crawl and render JavaScript?
Google handles JavaScript pages in three phases: crawl, render and index. Its guide to JavaScript SEO basics lays them out.


- Crawl. Googlebot fetches the URL and reads the raw HTML. It checks robots.txt first. If a URL is blocked, it skips it.
- Render. Pages that return a 200 status go into a queue. A headless Chromium browser later runs the JavaScript and builds the final page. Google says a page "may stay on this queue for a few seconds, but it can take longer than that."
- Index. Google reads the rendered HTML, finds links and stores the content.
A headless browser is a browser with no screen. It loads a page and runs its scripts the way Chrome does, but for a machine.
The key line in Google's doc is this: "If the content isn't visible in the rendered HTML, Google won't be able to index it." Rendering isn't the hard part for Google. The hard part is your content showing up in time, without a click and from files Google is allowed to fetch.
Why the second pass matters
Raw HTML gets processed right away. Rendered content waits its turn. For a small site, the wait rarely matters. For a site with thousands of pages that change often, it adds up. New pages take longer to show up. Updates take longer to stick.
It also costs Google more to render a page than to read plain HTML. On big sites, that ties into crawl budget, the number of URLs Google will fetch from you in a given time. My crawl budget guide covers when that limit actually bites.
Which rendering mode should you use?
There are four common ways to build a page. Each one decides when the HTML gets made and who makes it.
| Mode | How it works | What a crawler gets first | Best for |
|---|---|---|---|
| Client-side rendering (CSR) | The server sends a near-empty shell. The browser runs JavaScript to build the page. | An empty shell, until rendering | Logged-in apps and dashboards |
| Server-side rendering (SSR) | The server builds full HTML for each request. | Full content | Pages with fresh or personal data that must rank |
| Static site generation (SSG) | Pages are built once at deploy time and served as files. | Full content | Marketing pages, blogs, docs, glossaries |
| Hydration | Server or static HTML first, then JavaScript adds interactivity in the browser. | Full content, then interactive | Most modern marketing sites |
Google's guidance is clear. Its doc on dynamic rendering calls that approach "a workaround and not a recommended solution." Dynamic rendering means sending bots a pre-rendered copy while users get the JavaScript version. Instead, Google says to "use server-side rendering, static rendering, or hydration as a solution."
What I'd pick
For anything that needs to rank, I'd use static generation first and server rendering second. Marketing pages, pricing, blog posts, docs and comparison pages don't need to be built in the browser. Build them ahead of time and serve plain HTML.
Keep client-side rendering for the parts behind a login. Your app dashboard doesn't need to rank. Your pricing page does.
If you run Next.js, most of this is a setting, not a rebuild. My guide to Next.js SEO on Vercel covers which rendering mode to use for each page type.
Do AI crawlers run JavaScript?
This is where JavaScript SEO gets new stakes. Google renders. Many AI crawlers, as far as anyone has measured, don't.


Start with what the vendors say. OpenAI's overview of its crawlers explains each bot. OAI-SearchBot surfaces sites in ChatGPT search. GPTBot collects content that may be used for training. ChatGPT-User visits pages when a user asks. The page explains how to allow or block each one in robots.txt. It says nothing about running JavaScript.
So the vendor docs don't confirm rendering either way. For evidence, the best public data I've seen comes from Vercel. Its study of crawler traffic on its own network, The rise of the AI crawler, published in December 2024, found:
- None of the major AI crawlers it tracked rendered JavaScript. That list included GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot and PerplexityBot.
- ChatGPT and Claude did fetch JavaScript files. They made up 11.50% of ChatGPT's requests and 23.84% of Claude's. But the crawlers didn't run them.
- Gemini uses Google's crawling setup, so it renders JavaScript.
- AppleBot renders JavaScript through a browser-based crawler.
The same study found AI crawlers wasted a lot of requests on dead pages. 404 errors made up 34.82% of ChatGPT's fetches and 34.16% of Claude's, against 8.22% for Googlebot.
34.82%
Share of ChatGPT crawler fetches that hit a 404
Vercel, Dec 2024
8.22%
Share of Googlebot fetches that hit a 404
Vercel, Dec 2024
Crawlers change, and this is one network's data from one month. But the safe bet is obvious. If you want ChatGPT, Claude or Perplexity to read and cite your pages, put the content in the raw HTML. Don't make an AI crawler run your bundle to find your pricing.
What are the most common JavaScript SEO failures?
Most failures fall into a short list. Here's what each looks like and how to fix it.
| Failure | What Google or an AI bot sees | Fix |
|---|---|---|
| Links without an href | No link, so the page behind it is never found | Use <a href="/page"> for every navigable page |
| Content after a click | Only the default state of tabs, accordions or "load more" | Put the content in the HTML and hide it with CSS, or give it its own URL |
| Blocked resources | A broken or empty render | Allow the scripts, styles and APIs the page needs in robots.txt |
Fragment URLs (#/pricing) |
One URL for many views | Use the History API and real paths |
| Soft 404s in single-page apps | A 200 status on a "not found" view | Return a real 404, or add noindex to the error view |
| Titles and meta set late | Generic or missing titles in raw HTML | Set metadata on the server |
| Content from slow API calls | A loading spinner | Fetch data on the server or at build time |
Links without hrefs
Google finds links through anchor elements with an href attribute. A <span onClick> or a <button> that changes the page isn't a link to a crawler. The page behind it may never get found.
<!-- Crawlable -->
<a href="/pricing">Pricing</a>
<!-- Not crawlable -->
<span
<button
Script-built links are fine, as long as the rendered result is a real anchor with an href.
Content that only loads after a click
Crawlers don't click. If your FAQ answers load from an API when someone opens the accordion, the answers aren't in the page Google indexes. Same for tabs that fetch content on click, and "load more" buttons on blog lists.
The fix is to ship the content in the HTML and use CSS to show or hide it. For long lists, use real paginated URLs with links, such as /blog/page/2.
Blocked resources
Google's doc is direct: Google Search "won't render JavaScript from blocked files or on blocked pages." A robots.txt rule that blocks /static/ or /api/ can leave Google with a broken page. Check your rules with a robots.txt generator and keep what the page needs open. A short primer on robots.txt covers the syntax.
How do you test what Google actually sees?
Your browser lies to you. It runs every script, uses your cookies and waits as long as it takes. Test what a crawler gets instead.
Use the URL Inspection tool
Search Console's URL Inspection tool has two views. The indexed view shows what Google stored last time. The live test fetches the page now.
Run a live test, then open "View tested page." It shows a screenshot of the rendered page, the raw HTML, the page resources and the JavaScript console output. Google notes that screenshots aren't available for the indexed version, so the live test is where you see one.
Three things to check every time:
- Search the rendered HTML for a sentence from your main content. If it's missing, Google can't index it.
- Check page resources for anything blocked or failed.
- Read the console output for script errors that stop the render.
Keep two limits in mind. A passing live test only confirms Google can access the page. It doesn't promise indexing. And there's a daily limit on live tests and on indexing requests per property. My Google Search Console guide covers the rest of the tool.
Test what AI crawlers see
AI crawlers read the raw HTML. So look at the raw HTML. Fetch the page from the command line, with no JavaScript, and search it for your main copy.
curl -s https://example.com/pricing | grep -i "per seat"
If the phrase shows up, a crawler that doesn't run JavaScript can read it. If it doesn't, that content is invisible to those bots. You can also turn off JavaScript in your browser's dev tools and reload. Whatever disappears is at risk.
Watch the index coverage report
A rendering problem often shows up as pages that Google crawls but won't index. If a template has many pages stuck there, check whether its main content is in the raw HTML. My guide to crawled, currently not indexed covers the other causes.
How do you audit a JavaScript site, step by step?
Here's the order I work in. It moves from cheap checks to expensive fixes.
- List your page templates. Home, pricing, product, blog, docs, landing pages and any directory or programmatic pages.
- Fetch one URL per template without JavaScript. Note which ones are missing main content, links or metadata.
- Run a live URL Inspection test on each failing template. Compare the raw and rendered HTML.
- Check robots.txt for blocked scripts, styles and APIs.
- Crawl the site with JavaScript rendering on and off. Compare link counts and word counts.
- Move failing templates to static or server rendering, starting with the ones that drive revenue.
Fold this into a wider technical SEO audit, so rendering issues get fixed next to redirects, canonicals and speed.
Worked example: moving a directory from client to static rendering
This is a worked example with assumed numbers. Plug in yours.


Say a SaaS startup has a 600-page integration directory. Each page is built in the browser from an API call. In Search Console, assume only 240 of the 600 pages are indexed after six months. The rest sit as crawled but not indexed, or never got crawled at all.
The team moves the directory to static generation. Every page now ships full HTML with real links between them. Assume that within three months, 540 pages are indexed.
Now the traffic. Say each indexed page brings an assumed 20 organic visits a month. Before, that's 240 × 20 = 4,800 visits. After, 540 × 20 = 10,800 visits.
Say 1.5% of visits become signups. Before, that's 72 signups a month. After, it's 162.
The gain doesn't come from tricks. It comes from every page being readable on the first fetch, with links that crawlers can follow. And those same pages are now readable by AI crawlers that skip JavaScript.
What are the common JavaScript SEO mistakes?
Trusting your own browser. It always renders. Crawlers don't always wait, click or fetch what you blocked.
Rendering marketing pages in the browser. A pricing page doesn't need client-side rendering. Build it ahead of time.
Assuming AI bots work like Google. Google renders JavaScript. Vercel's data says most AI crawlers didn't.
Using dynamic rendering as a long-term fix. Google calls it a workaround. It doubles what you maintain.
Shipping noindex in the raw HTML and removing it with JavaScript. Google may see the noindex first and skip the render.
Fixing the home page and forgetting the templates. One broken template can hide thousands of pages.
What should you do this week?
If a rebuild is on the table, plan the rendering choice before the design. My website relaunch use case shows how I scope it, and my website service builds marketing sites that ship full HTML by default, so search engines and AI crawlers read every page on the first fetch. For the indexing side of this, see my primer on indexing and the wider view of technical SEO.
My take: render for the dumbest crawler
Google is a very good crawler. Plan for the worst one instead.
The worst crawler fetches your raw HTML once, doesn't run a line of JavaScript and moves on. In 2026, that describes a lot of the bots that decide whether AI tools cite you. If your content survives that crawler, it survives all of them.
So keep JavaScript for what it's good at: interactivity, app screens and the parts behind a login. Ship everything you want found as plain HTML. It's faster for users too.
FAQ
Can Google crawl JavaScript websites?
Yes. Google crawls the HTML, then renders the page with JavaScript in a second step and indexes what it sees. Google says a page may wait in the render queue for a few seconds or longer. The risk isn't that Google can't run JavaScript. It's that content or links appear late, only after a click, or from files that robots.txt blocks.
Is server-side rendering better for SEO?
For pages that need to rank, yes. Server-side rendering or static generation sends the full content in the first HTML response. Google can index it without waiting to render, and crawlers that don't run JavaScript can still read it. Google recommends server-side rendering, static rendering or hydration over workarounds like dynamic rendering.
Do AI crawlers like GPTBot run JavaScript?
OpenAI's crawler docs explain what each bot does and how to control it in robots.txt, but they don't say the bots run JavaScript. A 2024 study of Vercel's network found that major AI crawlers, including GPTBot and ClaudeBot, fetched JavaScript files but didn't execute them. Plan as if AI bots read only your first HTML response.
How do I check if Google can see my JavaScript content?
Use the URL Inspection tool in Search Console. Run a live test, then open the tested page to see the rendered HTML, a screenshot, the page resources and any JavaScript console errors. Search the rendered HTML for a sentence from your main content. If it's missing, Google can't index it.
Do links built with JavaScript pass SEO value?
They can, if they end up as normal anchor elements with an href attribute in the rendered HTML. Google finds links through a elements with an href. Links built from buttons or onClick handlers with no href aren't crawlable links. Use real anchors for every page you want found, even inside a JavaScript app.
Is dynamic rendering still a good fix?
No. Google now calls dynamic rendering a workaround and not a recommended solution, because it adds complexity and cost. It means serving bots a different, pre-rendered version than users get. Move important pages to server-side rendering or static generation instead, so every visitor and crawler gets the same full HTML.