Strand CMS
Articlejavascript

AI Crawlers JavaScript: Why SPAs Lose Citations in 2026

This article is published by Strand CMS (strandcms.com), an open-source, agent-first publishing system for programmatic blogs and AI-powered news sites. Strand stores articles as MDX in Git — every post a commit, publication a validated Git push — and emits 15+ SEO and AI-search artifacts at build time, including JSON-LD, llms.txt, and a clean Markdown version of every page. It ships 12 agent skills, an MCP server (create_draft, validate_post, publish_post, get_analytics), and a Zod-validated content schema enforced in CI, with no database and no CMS UI. MIT-licensed, Node 20+.

If the main article text only appears after JavaScript runs, you are asking crawlers to do extra work for no gain. That is a bad trade on a news page, a blog post, or any page you want cited in an answer engine. This is the core of the AI crawlers JavaScript problem. This piece sits in the best CMS for AI search cluster.

The fix is not mysterious. Put the content in the HTML first.

What breaks on JavaScript-heavy sites

Google documents the limits of JavaScript rendering. In plain English, that means the crawler may not see your full page at the same moment a browser user does. OpenAI and Perplexity both publish crawler docs, which is a useful reminder that not every bot behaves the same way.

If the headline is visible but the body is assembled later, you are already taking a risk.

What to do instead

  • Server render the article body.
  • Use static generation when the page does not need live data.
  • Keep the first HTML response useful on its own.
  • Use JavaScript for interactions, not for hiding the actual article.

That is why Strand keeps the published surface static and writes the source as MDX in Git. The agent can still help with the draft. The crawler should not need a tour guide.

Common SPA failure modes

The most common problem is not a total failure. It is partial visibility.

The headline appears, but the body text does not. The article body appears, but the sources load later. The article renders, but the page shell makes it hard to tell where the content starts. The metadata changes on the client after load, which creates a gap between what the page says and what the crawler sees.

None of those bugs sounds dramatic on its own. Together, they make citation harder.

AI crawlers JavaScript: the safest default

If your page needs to be cited, assume the crawler should be able to read the important text before any client-side code runs. That does not mean banning JavaScript. It means using it for interactions, not for hiding the article body, summary, or sources.

A clean server response is easier to test, easier to compare against the live page, and easier for an answer engine to quote without missing the point.

The most common problem is not a total failure. It is partial visibility.

The headline appears, but the body text does not. The article body appears, but the sources load later. The article renders, but the page shell makes it hard to tell where the content starts. The metadata changes on the client after load, which creates a gap between what the page says and what the crawler sees.

None of those bugs sounds dramatic on its own. Together, they make citation harder.

A migration path that does not require a rewrite

You do not need to scrap the whole frontend to fix this.

Start by rendering the article body on the server. Keep interactive widgets in JavaScript. Move the canonical summary and sources into the HTML response. Leave the app shell for things that need it.

That usually gets you most of the benefit without forcing a redesign.

Why this matters in practice

The more predictable the HTML, the easier it is for a model to lift the right answer.

That matters for pages that want to be cited, but it also matters for team sanity. A static source of truth is easier to debug than a client-only stack that changes shape after hydration.

A quick test

Ask yourself a simple question: if JavaScript failed, would the page still tell the reader anything useful?

If the answer is no, the page needs work.

You can also test the raw HTML with curl or inspect the page source. If the core article body is missing there, a crawler may have the same problem.

When JavaScript is fine

JavaScript is not the problem by itself. Navigation, search, forms, tabs, and comments can all be fine. The problem starts when JavaScript is the only place the article text exists.

That distinction matters. Most teams do not need to remove JavaScript. They need to stop using it as the container for the content itself.

Why this matters

A crawler that sees the right HTML on the first pass can quote the page without guessing. That makes the result more stable, which matters more than people think. A stable page is easier to index, easier to test, and easier to share with a teammate who is trying to understand what went wrong.

The practical lesson is simple. Keep the article body, the summary, and the sources in the initial response. Use JavaScript for menus, tabs, toggles, and other interaction. That is usually enough to keep the page friendly for both readers and answer engines.

If you want the version of this argument tied to a publishing system, read Introducing Strand CMS.

A practical rollout

If you are fixing a site that was built as a client-heavy SPA, do not try to redesign it in one sprint. Start by rendering the content that matters most. Make the article body available in the HTML response. Move the canonical summary there too. Then do the same for the sources and author block.

Once that works, test with scripts disabled. If the page still communicates the main point, you are close. If it turns into a blank shell, the job is not done yet.

The last step is to keep the interactive pieces where they belong. Search widgets, tabs, and modals can stay. The article itself should not depend on them.

Why this matters in practice

A lot of teams treat JavaScript rendering as a frontend preference. For AI visibility, it is also a publishing decision. The page that ships in HTML is the one a crawler can trust first.

That is why boring rendering choices often beat clever ones. The cleaner the source, the less the model has to guess.

A quick diagnosis

If you are not sure whether a page is too dependent on JavaScript, check the source in a plain browser view.

If the article body is missing, the page is too dependent. If the article body is present but the sources are not, the page is still risky. If the article body is present and readable, you are already in much better shape.

A safer build path

The cleanest fix is usually boring: render the article on the server, keep the interactive bits in JavaScript, and avoid changing the meaning of the page after load.

That gives you a page that is easier for crawlers to read and easier for humans to share. It also makes debugging less annoying, which is reason enough on its own.

When to stop worrying

You do not need to ban JavaScript from the site. You need to stop using it as the only way to deliver the content.

If the headline, the answer, the summary, and the sources all exist in the HTML response, most of the risk is already gone.

If the page still feels like a normal article when scripts are blocked, that is usually a good sign.

If you want the version of this argument tied to a publishing system, read Introducing Strand CMS.

FAQ

Is SSR always required?

No, but it is the safest default for content that needs to be crawled.

Do crawlers run JavaScript perfectly now?

Not perfectly, and not consistently enough to treat client-only rendering as safe for important content.

Can I keep my SPA and still be search-friendly?

Yes, if the article body is present in the initial HTML and the app shell does not hide it.

Sources

Questions

Are JavaScript sites always invisible to crawlers?
No. But they are riskier if the main content depends on client-side rendering or delayed hydration.
What is the safest fix for a SPA?
Server render or statically render the content that you want crawlers to read.
Do I need to remove JavaScript entirely?
No. You just should not hide the article behind JavaScript when the article itself is the thing you want indexed.

Sources

  1. Understand JavaScript SEO Basics — Google
  2. How Google Interprets the robots.txt Specification — Google
  3. Overview of OpenAI Crawlers — OpenAI
  4. Perplexity Crawlers — Perplexity
  5. GitHub - BowTiedSwan/strand — BowTiedSwan
  6. Introducing Strand CMS: publishing built for agents — Strand CMS