Text needs JavaScript

ai/content-needs-javascript

The page's HTML holds under 50 words before scripts run. Many crawlers, including some AI bots, run no scripts, so they see an almost empty page.

Severity
Medium
Area
AI readiness
Checked
Weekly, and with Check now
Health score
Weight 2
Scope
Each page; past 10 pages, one finding for the site

How Talewright checks it

The weekly crawl counts the words in the HTML the server sends, without running scripts.

How to fix it

Render the page's text on the server, so crawlers that run no scripts see it.

The problem

The server sends a page whose HTML is almost empty: a <div id="root"></div>, a few script tags and perhaps a loading spinner. The text arrives only after the browser runs the scripts and builds the page. A person with a browser sees the full page. A bot that reads the HTML and runs no scripts sees almost nothing, so it has nothing to quote, summarize or cite.

This is how a client-rendered single-page app works by default, and it also happens when a page loads its text from an API after the first render.

Why it matters

Google renders JavaScript, but in a separate step: Googlebot fetches the HTML, queues the page for rendering in a headless Chromium, and indexes the rendered result. Google still calls server-side rendering or pre-rendering “a great idea”, because it is faster for users and crawlers and because not all bots can run JavaScript.

The crawler documentation of OpenAI, Anthropic and Perplexity describes what their bots are for and how robots.txt controls them. None of it says that the bots run scripts, so a website should not count on it. Text in the served HTML is the one form every crawler can read.

Google calls dynamic rendering, where crawlers get a separate server-rendered copy, a workaround and not a long-term solution, and points to server-side rendering, static rendering or hydration instead.

Fixing it

  1. Fetch the page without scripts: curl -s https://example.com/page/ and look for the page’s main text in the output.
  2. Find how the framework renders the route. Most frameworks can render a page on the server or at build time; switch the route to one of those modes.
  3. Move the text out of data that loads in the browser after the first render, and into data the server or the build reads.
  4. Keep scripts for interaction. Hydration adds them to the server-rendered HTML.
  5. Run curl again and confirm the text is there.

Failing, the HTML the server sends:

<body>
  <div id="root"></div>
  <script src="/assets/app.js"></script>
</body>

Passing, the same page rendered on the server:

<body>
  <div id="root">
    <main>
      <h1>Handmade oak desks</h1>
      <p>Each desk is built to order in solid oak, cut and joined by hand
        in our workshop, and finished with natural oil.</p>
      <p>Choose a size, a leg style and a finish. We send photos while
        the desk is made, and it ships in six weeks, packed in a reusable
        wooden crate. Every desk comes with a ten-year guarantee on the
        joints and free repairs for the first year.</p>
    </main>
  </div>
  <script src="/assets/app.js"></script>
</body>

The setting usually lives in the framework’s configuration or in the route itself: an output or rendering mode, a static generation option, or the choice between a client-only and a server component. A website builder or CMS that renders pages in the browser may offer a server-rendered or static publishing option. web.dev’s overview of rendering compares the approaches.

Ask your agent

Pages on this website send HTML with almost no text before JavaScript runs, so crawlers that run no scripts see an empty page. Find how the routes are rendered and change them to server-side rendering or static generation, so the main text, headings and links are in the HTML the server sends. Keep the interactive behavior working through hydration. Verify with curl -s <url> for the home page and two other routes: the main text must appear in the output. List the routes you could not change and why.

Common mistakes

  • Server-rendering the layout only. The header and footer are in the HTML but the page’s own text still loads from an API in the browser.
  • Testing with a browser. The developer tools show the page after scripts ran. Use curl or view the page source.
  • Serving bots a different page. Google says content that differs completely between users and crawlers can be cloaking. Render the same page for everyone.

See also the AI search guide.

Sources

Updated 2026-11-26. Rule version 1.

Get early access.

Talewright is invite-only. Tell us about your team and the marketing you want to win.