How to Fix Content That Isn't Readable Without JavaScript
If your pages ship an almost empty HTML shell and build the text in the browser with JavaScript, most AI crawlers see nothing worth quoting. This guide shows you how to find those pages, move the important text into the server-delivered HTML with SSR, static generation or prerendering, and confirm the raw HTML now carries the content.

Why it matters
Crawlers such as GPTBot, OAI-SearchBot, ClaudeBot and PerplexityBot generally fetch the raw HTML and do not execute JavaScript. A page that returns an empty <div id="root"></div> gives them nothing to index, summarize or cite, so the page drops out of AI answers. Google does render JavaScript, but rendering is queued and can fail on timeouts or blocked resources.
Visitors on slow devices also wait longer to see content. Server-rendered text removes all of these risks.
What you need
Step-by-step fix
Measure the text in the raw HTML
Fetch each key page the way a non-rendering crawler does and count the visible words and script tags. A page is a problem when it has fewer than 50 words of text in the raw HTML and more than 3 scripts. The site fails when that applies to 20% or more of crawled pages.
Run the commands below on your homepage, a product or service page, a blog post and your pricing page first.
curl -sL -A "Mozilla/5.0 (compatible; GPTBot/1.0)" https://example.com/pricing -o raw.html
grep -o "<script" raw.html | wc -l
python3 -c "import re;h=open('raw.html',encoding='utf-8').read();h=re.sub(r'(?is)<(script|style|noscript|template)[^>]*>.*?</\1>',' ',h);print(len(re.sub(r'<[^>]+>',' ',h).split()))"Find what is building the content in the browser
Open the page source with View Page Source (Ctrl+U), not the Elements panel, and look for the main copy. Common causes:
- A client-side SPA (Create React App, Vite + React/Vue, Angular without SSR) that mounts into an empty div
- Next.js components marked 'use client' that load text with useEffect + fetch
- Product descriptions, reviews or FAQs injected by third-party widgets
- Text loaded on scroll, on tab click or behind a "Load more" button
Note which pattern each failing template uses, because the fix differs.
Switch key templates to server or static rendering
The durable fix is to generate the HTML on the server. Use static generation for pages that rarely change, and server-side rendering or incremental regeneration for everything else. Framework options:
- Next.js: keep data fetching in Server Components (no 'use client') in the App Router
- Nuxt: keep
ssr: true(the default) and fetch withuseFetch/useAsyncData - SvelteKit: use
+page.server.jsload functions - Angular: add SSR with
ng add @angular/ssr - Astro: render content at build time and hydrate only the interactive islands
// app/products/[slug]/page.jsx (Server Component: no 'use client')
export const revalidate = 3600;
export default async function ProductPage({ params }) {
const { slug } = await params;
const product = await fetch(`https://api.example.com/products/${slug}`)
.then(r => r.json());
return (
<article>
<h1>{product.name}</h1>
<p>{product.description}</p>
<AddToCartButton id={product.id} />{/* only this part needs client JS */}
</article>
);
}Prerender if you can't migrate the app yet
If a full SSR migration isn't realistic this quarter, generate static HTML snapshots of your public routes at build time. Use a tool such as vite-plugin-ssr/Vike prerendering or react-snap-style headless prerendering, then serve those files from your host. A prerendering proxy service is a fallback.
Google calls this "dynamic rendering" and treats it as a workaround, so plan to move to real SSR later.
# Nginx: serve a prerendered snapshot if one exists, else the SPA shell
location / {
try_files /prerendered$uri/index.html $uri $uri/ /index.html;
}Put hidden and widget content into the HTML
Tabs, accordions and "Read more" sections should ship their text in the HTML and hide it with CSS or native elements, not fetch it when clicked. Ask review, FAQ and spec widget vendors for a server-side or Liquid/PHP embed that outputs text in the page source. Render at least the first page of reviews server-side.
Don't hold the main copy back for infinite scroll.
<details> <summary>What does Example Co's Pro plan include?</summary> <p>Pro includes 10 users, priority support and SSO for $49/month.</p> </details>
Trim scripts on content pages
The audit flags pages that are both thin and script-heavy. Once the text is in the HTML, remove unused tags in Google Tag Manager and drop duplicate analytics or chat widgets. Load non-critical scripts with defer or after interaction.
This also improves INP and LCP.
<script src="/js/chat-widget.js" defer></script>
Re-test raw HTML and rendered output
Repeat the curl and word-count commands from step 1 on every template you changed. Each key page should now return well over 50 words, including its H1 and main copy. Then check that the rendered page still works: use URL Inspection > View Tested Page in Google Search Console and click through interactive features with JavaScript enabled.
Finally, re-run the audit and confirm fewer than 20% of pages are flagged.
for u in / /pricing /products/widget /blog/getting-started; do curl -sL -A "ClaudeBot" "https://example.com$u" | grep -o "<h1[^>]*>[^<]*" | head -1 done
Platform-specific notes
WordPress
Classic themes and the block editor render content in PHP, so most WordPress pages pass. Failures usually come from page-builder sliders, JS-only tabs, or a headless setup (WPGraphQL + React SPA). If you run headless, use Next.js or Faust.js with SSR/SSG rather than client-side fetching.
Shopify
Liquid themes are server-rendered. Problems come from apps that inject product descriptions, reviews, size charts or FAQs with JavaScript. Pick apps that offer theme app blocks rendering Liquid server-side. For headless Hydrogen stores, keep data loading in route loaders (SSR is the default).
Next.js
The most common failure is a page file with 'use client' at the top that fetches content in useEffect. Move fetching into Server Components or generateStaticParams. Avoid next/dynamic with ssr: false for any component that holds main copy.
React / Vue SPA (Vite, CRA)
Pure client-side apps fail by design: the HTML is just a root div. Migrate public pages to Next.js, Remix/React Router framework mode, Nuxt or Astro, or add build-time prerendering. Logged-in app screens can stay client-side.
Wix / Webflow / Squarespace
These builders server-render native text elements, so content typed into the editor is in the HTML. Text added through custom code embeds, iframes or third-party widgets is not. Move that copy into native text blocks or CMS fields.
Check that it worked
✅ How to verify
- Run curl on each key URL and confirm the H1 and main paragraphs appear in the raw response, with more than 50 words of visible text.
- In Chrome DevTools, disable JavaScript (Ctrl+Shift+P > "Disable JavaScript") and reload: the core content should still be readable.
- Use Google Search Console URL Inspection > Test Live URL > View Tested Page > HTML to confirm the content and the rendered page match.
- Re-run the audit and confirm the number of thin, script-heavy pages is below 20% of pages crawled.
⚠️ Common mistakes
- Assuming you are fine because Google renders JavaScript. Most AI crawlers fetch only the raw HTML.
- Stuffing a <noscript> block with keyword text instead of rendering the real content. It doesn't match the user experience and is easy to let drift out of date.
- Serving a different, richer page only to bot user agents. That is cloaking; prerendered snapshots must match what users see.
- Server-rendering the layout and navigation but still loading the main article, product description or pricing table with fetch after hydration.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Do ChatGPT, Claude and Perplexity crawlers run JavaScript?
Generally no. GPTBot, OAI-SearchBot, ClaudeBot and PerplexityBot fetch the HTML response and parse it without running client-side JavaScript. Text that only appears after scripts execute is usually invisible to them.
Does Google index JavaScript-rendered content?
Yes. Googlebot renders pages with an evergreen Chromium, but rendering is deferred and can miss content behind slow API calls, user interaction or blocked resources. Server-rendered HTML is indexed faster and more reliably.
Is dynamic rendering or prerendering considered cloaking?
Not if the prerendered HTML contains the same content users see. Google describes dynamic rendering as a workaround rather than a long-term solution, so treat it as a bridge to SSR or static generation.
Do I need to remove JavaScript from my site?
No. Keep JavaScript for interactivity: carts, filters, forms, carousels. The goal is that headings, body copy, prices and FAQs are already in the HTML before any script runs, and JavaScript only enhances them.
How to Get Your Brand Mentioned in ChatGPT Answers
How to Create and Publish an llms.txt File for AI Tools
How to Get Your Brand Mentioned in Perplexity Answers
How to Fix a CDN or WAF Blocking AI Crawlers
How to Get Your Brand Cited in Google AI Overviews
How to Set an Explicit Google-Extended Policy in robots.txt