Skip to content
Renderly
Menu

Guide

JavaScript SEO: technical SEO for JavaScript and headless sites

JavaScript SEO comes down to what is in the HTML before any script runs. Googlebot renders JavaScript, eventually. GPTBot, ClaudeBot, PerplexityBot and most other AI crawlers do not, so anything that only appears after client-side rendering is invisible to them. Ship your content, links and metadata in the server HTML.

By Renderly · Updated 16 November 2026 · 14 min read

Short answer

  • If content, links or metadata appear only after JavaScript runs, most AI crawlers will never see them.
  • Googlebot renders JavaScript in a second pass that can lag the crawl, and it may skip rendering for non-200 pages and pages with noindex in the raw HTML.
  • SSG and SSR put content in the first HTML response; client-side rendering does not.
  • Most headless SEO problems are configuration problems: indexed preview URLs, missing canonicals, soft 404s and unbounded facet URLs.
  • Test with curl first. If the raw HTML is missing something, assume half the crawlers are missing it too.

JavaScript SEO is the part of technical SEO that makes sites built with React, Next.js, Vue and other JavaScript frameworks crawlable and indexable. Googlebot renders JavaScript, but in a separate pass that can lag behind the crawl. Most AI crawlers, including GPTBot, ClaudeBot and PerplexityBot, fetch your HTML and never execute the JavaScript. If your content, links or metadata only exist after client-side rendering, a large share of the systems that decide whether you get cited cannot see them.

This guide covers the rendering modes, how Google and AI crawlers differ, the headless CMS mistakes we see most, and a repeatable way to test a site. It ends with a checklist.

What rendering modes are there, and what does each one send?

The question that matters for SEO is simple: what is in the first HTML response? Everything else follows from it.

| Mode | How it works | First HTML response | Risk for crawlers | | ----------------------------------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- | | CSR (client-side rendering) | Server sends a shell; JavaScript fetches data and builds the page in the browser | Empty or near-empty div plus script tags | High. Non-rendering crawlers see nothing; Google depends on the render queue | | SSR (server-side rendering) | Server renders HTML on each request, then the client hydrates | Full content | Low, if the server returns correct status codes and metadata | | SSG (static site generation) | HTML built once at deploy time | Full content | Lowest. Watch for stale content and missing pages after deploys | | ISR (incremental static regeneration) | Static pages rebuilt in the background on a schedule or on demand | Full content, possibly a slightly stale version | Low. Watch that revalidation handles deleted items with a real 404 | | Streaming SSR and React Server Components | Server sends HTML in chunks as data resolves; suspended sections arrive later in the same response | The shell first, then chunks with the rest of the content | Medium. See below |

Streaming deserves a closer look because it is the default in recent Next.js App Router setups. With streaming, content inside a Suspense boundary is sent later in the same HTTP response, inside a hidden container, and a small inline script moves it into place. Google renders the page, so it sees the final layout. A crawler that does not run JavaScript gets the text, but at the end of the document and inside a hidden element, while the visible spot holds a loading fallback. Some text extractors drop hidden elements. Keep the main content and the H1 outside slow Suspense boundaries, and never put title, canonical or robots tags behind one. This is the first thing we look at for Next.js SEO: our Next.js technical audit checks Suspense boundaries and streamed metadata on every route.

The RSC payload (the serialized component tree in inline scripts) also duplicates much of the page text in a form only the framework can read. It does not hurt indexing, but it inflates HTML size, which matters for crawlers with response size limits.

For definitions, see server-side rendering, client-side rendering, static site generation and hydration.

How does Google render JavaScript?

Google’s JavaScript SEO basics describe three phases: crawling, rendering and indexing. Googlebot fetches the URL, parses links from the raw HTML, and queues the page for rendering. A headless evergreen Chromium renders it when resources allow, and Google indexes the rendered HTML.

Google says a page may sit in the render queue for a few seconds, “but it can take longer than that.” Several details in that document cause most real-world problems:

  • Non-200 pages may not be rendered. If a URL returns a 404 or 500, Google may skip rendering. A client-side app that shows real content on a URL that returns an error status will not get that content indexed.
  • noindex in the raw HTML can stop rendering. If the initial HTML contains noindex, Google may skip rendering, so JavaScript that later removes the tag does not help.
  • Canonicals should be in the HTML. Google advises against using JavaScript to change the canonical to a different URL than the one in the raw HTML.
  • Links must be real anchors. Google discovers links from a elements with an href. Click handlers on div or button elements are not links, and URL fragments (#/products) do not load distinct pages for Google.

Google’s May 2026 guide on generative AI features repeats that Google can process JavaScript content as long as it is not blocked. Gemini and AI Overviews draw on the same index, so for Google the rules are the normal JavaScript SEO rules.

Do AI crawlers execute JavaScript?

Mostly no. The best public measurement is Vercel and MERJ’s analysis, published in December 2024, which looked at crawler traffic across Vercel’s network. It found that none of the major AI crawlers it measured rendered JavaScript:

| Crawler | Operator | Renders JavaScript (Vercel/MERJ, Dec 2024) | | ------------------------------------------- | ---------- | ------------------------------------------ | | GPTBot, OAI-SearchBot, ChatGPT-User | OpenAI | No | | ClaudeBot | Anthropic | No | | PerplexityBot | Perplexity | No | | Meta-ExternalAgent | Meta | No | | Bytespider | ByteDance | No | | Googlebot (used by Gemini and AI Overviews) | Google | Yes | | Applebot | Apple | Yes |

The same study found that ChatGPT’s and Claude’s crawlers did download JavaScript files (about 11.5% and 23.8% of their requests), but did not execute them. Microsoft Copilot was left out because it lacks a distinct user agent.

That study is now almost two years old. We have not seen a newer public measurement that contradicts it, and none of the vendors’ crawler documentation (OpenAI, Anthropic, Perplexity) says their crawlers render pages. Anthropic now runs three agents (ClaudeBot for training, Claude-SearchBot for search, Claude-User for user-requested fetches), and OpenAI and Perplexity split theirs the same way. Our working assumption, and the one we test against, is that any AI fetcher reads raw HTML only.

The practical consequence: for AI visibility, the raw HTML is the page. Your answer-first paragraph, your headings, your internal links and your JSON-LD need to be in it. More on crawler access and robots.txt rules is in the glossary entry on AI crawlers, and on how those systems pick what to cite in how LLMs choose sources.

What goes wrong on headless CMS sites?

Headless setups split content (the CMS) from presentation (the frontend). That split is good engineering, but SEO settings that a monolithic CMS handled for you now have to be built by hand, and they often are not. These are the problems we find most often when we do technical SEO for headless sites.

Preview and deployment URLs get indexed. Every pull request on Vercel, Netlify or a similar host gets its own URL, and CMS preview modes add more. If those hosts are public and return 200, Google can find them through shared links or referrer leaks, and you end up with duplicates of your production pages under a different domain. Fix: protect previews with authentication, send X-Robots-Tag: noindex on all non-production hosts, and keep production canonicals absolute.

Missing or wrong canonicals. The frontend template forgets the canonical tag, or builds it from the request host so preview pages canonicalize to themselves. Every indexable page needs an absolute canonical pointing at the production URL, rendered on the server. See canonical URL.

Soft 404s. The CMS deletes an entry, but the frontend route still returns 200 with an “item not found” message rendered client-side. Google classifies these as soft 404s, and they waste crawl budget. Return a real 404 or 410 from the server when the CMS has no entry. On a pure SPA where that is not possible, Google suggests redirecting to a URL that returns 404 or adding a noindex robots tag on error views.

Client-side routing without real links. Navigation built with onClick handlers and router.push works for users but gives crawlers no links to follow. Use your framework’s link component, which renders an a element with an href.

Infinite facet and filter URLs. Commerce frontends generate a URL for every combination of color, size, price and sort order. Crawlers can spend most of their time on near-duplicate pages. Google’s guide on faceted navigation recommends blocking facet URLs you do not want crawled with robots.txt, or using URL fragments for filters that should not be indexed, and keeping parameter order consistent.

hreflang built from the wrong source. Localized headless sites often generate hreflang tags from the frontend’s locale list, not from what actually exists in the CMS. The result points at translations that 404 or that redirect to the default language. Generate hreflang from published CMS entries, make the tags reciprocal, and include an x-default. Google’s localized versions documentation lists the requirements.

Metadata set only in the client. Title, description and Open Graph tags set with a client-side head manager are missing from the raw HTML. Google may pick them up after rendering, AI crawlers and social previews will not.

Sitemaps out of sync. The sitemap is built once at deploy time, while the CMS publishes all day. New pages wait for the next deploy to be discovered. Generate the XML sitemap on request from the CMS, or rebuild it on publish webhooks.

Example scenario: a headless store with roughly 4,000 products moves from a hosted platform to a Next.js frontend. Products render on the server, but category pages fetch products client-side, and filters write query parameters for every combination. In the raw HTML, category pages have a heading and no product links. Google finds the products eventually through the sitemap, AI crawlers see empty categories, and the crawl log is dominated by filter URLs. The fix is server-rendering the first page of each category with real links, and keeping filter URLs out of the crawl.

How do you test what crawlers actually see?

We run the same method on every audit. It needs a terminal, a browser and Search Console access.

1. Fetch the raw HTML. This is the AI crawler’s view.

curl -sL -A "Mozilla/5.0 (compatible; GPTBot; +https://openai.com/gptbot)" \
  https://www.example.com/guides/some-page/ -o raw.html

# What is in it?
grep -o '<title>[^<]*' raw.html
grep -o '<link rel="canonical"[^>]*>' raw.html
grep -c '<a ' raw.html
grep -c 'application/ld+json' raw.html

Sending a crawler user agent catches sites that serve bots differently. Some CDNs and bot managers block or challenge AI user agents, so also check the status code with curl -sI.

2. Capture the rendered DOM. This approximates Google’s view.

npx playwright install chromium
node -e '
const { chromium } = require("playwright");
(async () => {
  const b = await chromium.launch();
  const p = await b.newPage();
  await p.goto(process.argv[1], { waitUntil: "networkidle" });
  require("fs").writeFileSync("rendered.html", await p.content());
  await b.close();
})();
' https://www.example.com/guides/some-page/

3. Diff them. Strip scripts and compare visible text, links and head tags. A quick version:

diff <(grep -o 'href="[^"]*"' raw.html | sort -u) \
     <(grep -o 'href="[^"]*"' rendered.html | sort -u)

Every link, heading or paragraph that appears only on the rendered side depends on JavaScript.

4. Check Google’s version. Run the URL through URL Inspection in Search Console, then “Test live URL” and “View tested page”. You get the rendered HTML, a screenshot, the HTTP status, blocked resources and console errors. The indexed result also shows which canonical Google selected, which often differs from the one you declared on headless sites.

5. Read the logs. Server or CDN logs show which URLs crawlers really request. Filter by user agent, then verify the important ones by IP: Google, OpenAI and others publish their IP ranges. Look for crawlers hitting preview hosts, facet URLs, 404s and redirects. Vercel’s study found AI crawlers spent a large share of requests on 404s, often from outdated URL lists, so redirect old URLs properly.

Repeat steps 1 to 3 for one URL per template (home, category, product, article, glossary), not for every page. Templates are where these bugs live.

JavaScript and headless SEO checklist

| Area | Check | Pass condition | | --------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | Content | Main heading and body copy | Present in raw HTML, outside slow Suspense boundaries | | Links | Internal navigation | a elements with href in raw HTML, no fragment routing | | Metadata | Title, description, robots, Open Graph | Rendered on the server, one of each | | Canonical | Every indexable page | Absolute production URL in raw HTML, not changed by JavaScript | | Status codes | Missing CMS entries | Server returns 404 or 410, no soft 404s | | noindex | Pages meant to be indexed | No noindex in the initial HTML | | Previews | Preview and branch deployments | Behind auth or sending X-Robots-Tag: noindex | | Facets | Filter and sort URLs | Blocked in robots.txt or kept out of crawlable links | | hreflang | Localized pages | Generated from published entries, reciprocal, with x-default | | Structured data | JSON-LD | In server HTML, not injected by a tag manager | | Sitemap | XML sitemap | Updated on publish, production URLs only, 200 status for every entry | | AI crawlers | robots.txt and CDN rules | GPTBot, OAI-SearchBot, ClaudeBot, Claude-SearchBot, PerplexityBot allowed if you want AI visibility, and not blocked by bot management | | Testing | Per template | Raw versus rendered diff done, URL Inspection checked |

renderly.net is built the way this checklist describes: static HTML with content, links and JSON-LD in the first response, and AI crawlers allowed. Run the curl command above against any page here and compare.

If you want this done on your site, our Next.js technical SEO audit runs this method on every template, and the wider technical SEO service covers fixes for other frameworks and headless CMS setups. For a short definition of the field, see JavaScript SEO.

FAQ

Does Google index JavaScript-rendered content?

Yes. Googlebot renders pages with an evergreen Chromium and indexes the rendered result. Rendering happens in a queue after the crawl, and Google may skip it for error pages or pages with noindex in the initial HTML, so server-rendered content is still the safer default.

Do AI crawlers like GPTBot and ClaudeBot run JavaScript?

Vercel and MERJ's December 2024 analysis found that none of the major AI crawlers they measured rendered JavaScript, including GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, PerplexityBot, Meta-ExternalAgent and Bytespider. Some fetch JavaScript files but do not execute them. Gemini uses Google's rendering infrastructure and Applebot renders too.

Is a single-page app bad for SEO?

A pure client-rendered SPA is a risk: the first HTML response is an empty shell for every URL. Google can usually recover the content, AI crawlers cannot. Most frameworks now offer SSR or prerendering per route, which fixes it without a rewrite.

Which rendering mode should a content site use?

Static generation for pages that change rarely, incremental regeneration or SSR for large catalogs that change often. Reserve client-side rendering for logged-in or highly personal views that should not be indexed anyway.

How do I stop headless CMS preview URLs from being indexed?

Put preview deployments behind authentication, or at minimum send an X-Robots-Tag noindex header on every preview host. Also make sure canonicals and sitemaps always use the production domain, never the deployment URL.

Next step

Want to know where your site stands?

Send us the URL. We run the crawl, the rendering check and an answer engine visibility sample, then reply with the three fixes that matter most.