RankDossier
Check family

JavaScript rendering problems: content that appears only after scripts

Search engines first read the HTML that the server sends and may render JavaScript later, if at all. These checks compare the plain HTML with the page after scripts run and look for important content, social tags or navigation that appear only after JavaScript, script errors, failed requests, hydration mismatches, and differences between browsers. Put the main text and tags in the first HTML.

How the problem happens

A single-page app renders on the client, so the first HTML is an empty shell. Tabs or infinite scroll load text only on a click, or a script changes the title, canonical or robots after the page loads.

Why JavaScript rendering problems cost rankings and citations

Google can run JavaScript, but it does so in a second step, later and with limits. Many other consumers of your page do not run it at all: social networks building a preview card, messengers, and a large share of AI crawlers that fetch the page to quote it. They read the first HTML response and nothing more. If the title, the social tags, the main text or the links only appear after scripts execute, those consumers see an empty or partial page, and your content is effectively missing from them.

The damage takes several forms. Content that exists only after a script runs may be indexed late or incompletely. A script that rewrites the title, the canonical or the robots tag means two audiences see two different instructions. Content hidden behind a click, a tab or an endless scroll is never requested by a bot that does not click or scroll. Script errors can break forms, menus and checkout for real visitors, and a mismatch between the server HTML and the client HTML can make the indexed text differ from what people read. For AI visibility the first HTML response is what counts for crawlers that do not run JavaScript, which includes many AI crawlers; some systems do render pages, so check each one you care about.

How to check JavaScript rendering by hand

Compare two views of the same page. The first is the raw response: fetch it with a command-line request or use view source, and read the title, the canonical, the robots tag, the social tags, the main heading and the body text. The second is the rendered page in the developer tools Elements panel. Anything you see in the second view but not in the first depends on JavaScript. Then turn JavaScript off in the browser and reload; what disappears is what a non-rendering bot will miss.

Open the console and the network panel on load. Red errors, and requests that fail for scripts, styles, fonts or images, point to broken functionality. Click through tabs and accordions and check whether their text was already in the page or was fetched on click. Scroll a long listing and see whether items appear only as you scroll. Finally, load the page in a second engine, such as Firefox or Safari, because a script that works in Chrome can fail elsewhere, and compare the amount of content and any horizontal scroll.

# What a bot that does not run JavaScript receives
curl -s https://example.com/page | grep -i -E "<title|og:title|<h1|canonical|robots"

<!-- Server-rendered head, present in the first HTML response -->
<title>Product name – Shop</title>
<link rel="canonical" href="https://example.com/product">
<meta property="og:title" content="Product name">

<!-- Tabs: text in the HTML, only hidden by CSS -->
<div role="tabpanel" id="specs" hidden>Full specification text…</div>

<!-- Infinite scroll with a crawlable fallback -->
<a href="/category?page=2" rel="next">Next page</a>

How to fix JavaScript rendering in code and on the server

The most robust fix is to deliver the important content in the first HTML. Use server-side rendering or static generation for pages that must rank or be quoted, and treat client-only rendering as acceptable only for parts that do not matter to search, such as a logged-in dashboard. Put the title, description, canonical, robots and social tags in the server-rendered head, and let scripts add behavior rather than change those values.

Keep tab and accordion text in the HTML and hide it with CSS or the hidden attribute instead of fetching it on click. Replace infinite scroll with, or back it by, real paginated links that a bot can follow, as in the example. Do not place essential text inside an <iframe>, because search engines and crawlers usually treat it as belonging to the embedded document, not to your page. For hydration, make sure the server and the client render the same markup; values such as the current time, random numbers or browser-only checks are the usual cause of a mismatch. Fix the console errors and failed requests that the load reveals, and test in more than one browser engine. In a CMS, avoid builders and plugins that inject core content with a script after load.

How RankDossier detects JavaScript rendering problems

RankDossier compares what the server sends with what the browser builds. The checks in this family report social tags that appear only after JavaScript, important content available only after JavaScript, content placed inside an iframe, and script changes to the title, canonical or robots values. They also report hydration mismatches, content that loads only on infinite scroll or on a click behind tabs, JavaScript errors and failed requests on load, and problems or layout differences that show up only in Firefox or Safari.

The AI citations guide explains why the first HTML response matters for assistants, the pages not indexed guide covers late and missing indexing, and the technical SEO audit guide places rendering among the other technical signals. To see how a link will look when shared, try the Open Graph checker.

Wrong and right

Wrong

<div id="root"></div>
<script>
  document.title = 'Pricing';
  async function load() {
    const res = await fetch('/api/text');
    root.textContent = await res.text();
  }
  load();
</script>
<title>Pricing</title>
<main id="root">
  <h1>Pricing</h1>
  <p>The main text is already in the HTML that the server sends.</p>
</main>

How to fix it

WordPress

Pick a theme or builder that prints the content in the HTML, avoid tabs and sliders that fetch the main text on click, and check what a script changes in the head.

Next.js

Render pages on the server or at build time with server components, keep metadata in the metadata export, and fix the hydration warning that the console shows.

// app/pricing/page.tsx is a server component: the text is in the first HTML
export default async function Page() {
  const text = await getText();
  return <main><h1>Pricing</h1><p>{text}</p></main>;
}

Nginx

Nginx only serves the files. Compare the HTML from curl with the page in a browser, and if the text is missing from curl, the fix belongs in the application.

# compare what the server sends with what the browser shows
curl -s https://example.com/pricing | grep -c '<h1'

Check codes in this family

These checks belong to this family. Each code appears in the audit report with its own explanation and fix.

  • OG_ONLY_JS Social tags only appear after JavaScript
  • CONTENT_JS_ONLY Important content only after JavaScript
  • CONTENT_IN_IFRAME Content inside an iframe
  • JS_CONSOLE_ERRORS JavaScript errors
  • REQUEST_FAILURES Failed requests on load
  • HYDRATION_MISMATCH Hydration mismatch
  • RENDER_DIFF_META JavaScript changes title, canonical or robots
  • ENGINE_ERRORS Problems only in Firefox or Safari
  • CONTENT_INFINITE_SCROLL Content only via infinite scroll
  • CONTENT_BEHIND_TABS Content loaded only on click
  • ENGINE_LAYOUT_DIFF Different rendering in Firefox or Safari

Read the full guide How to run a technical SEO audit and prioritize the fixes for the wider picture.

Check your own site

Enter a domain – the free pre-check reads up to 10 pages and shows how many types of problems it finds. You pay only if you want the full report.

Start the free pre-check