WSS
Web Specification Studio Home
18 min read
On this page
BlogSEOJavaScriptCrawlingGEOPublished · Updated 18 min read

Why Initial HTML Matters Beyond Google

Initial HTML controls visibility across AI bots, link unfurlers, and browsers because most non-Google crawlers skip client-side JavaScript.

Shipping an empty HTML shell (<div id="root"></div>) hides your page from AI search bots, chat link previews, and fast browser preloads.

Googlebot runs headless Chromium through its Web Rendering Service (WRS) to execute JavaScript in two-wave indexing. Almost every non-Google bot skips that step.

OpenAI’s OAI-SearchBot and GPTBot, Anthropic’s ClaudeBot, Perplexity’s PerplexityBot, and link scrapers like facebookexternalhit/1.1 and Slackbot-LinkExpanding 1.0 read only the raw HTML from your server.

Even when a bot or browser runs scripts, deferring core HTML behind JavaScript creates real production failures:

  • Truncated previews: Inline CSS or scripts push Open Graph tags past HTTP byte-range limits.
  • Broken delayed renders: New deploys delete old hashed .js chunks before Googlebot or Bingbot runs Wave 2.
  • Slower page speed: Client-built DOM hides images from the browser’s preload scanner, hurting First Contentful Paint (FCP) and Largest Contentful Paint (LCP).

Putting your main text, <a href> links, <link rel="canonical">, JSON-LD schema, and Open Graph <meta> tags in the initial HTTP 200 OK response solves all of these at once.

Who Reads Your Initial HTML (and Who Ignores JavaScript)

Teams often test a URL in Google Search Console, see a clean screenshot, and assume the whole web can read the page.

That assumption fails because Google pays the high compute cost of headless Chromium, while most other crawlers do not.

A December 2024 Vercel and MERJ study of over one billion monthly bot requests found zero evidence that major AI crawlers execute client-side JavaScript. ChatGPT bots spent 11.50% of requests fetching .js files, and Claude bots spent 23.84%, yet neither ran those scripts to build the DOM.

Between May 2024 and May 2025, Cloudflare Radar traffic telemetry recorded rapid growth in non-rendering bot volume:

  • GPTBot requests jumped 305% year-over-year, reaching 7.7% of search and AI bot volume.
  • ChatGPT-User live fetches climbed 2,825%.
  • PerplexityBot raw requests rose 157,490%.

The table below shows how each major client handles JavaScript, robots.txt under RFC 9309, and fetch limits:

Crawler / User-AgentOperator & PurposeRuns Client-Side JS?robots.txt ComplianceHard Fetch & Verification Rules
GooglebotGoogle Search & Gemini indexingYes (deferred WRS Chromium)Honored (500 KiB cap; 24h cache)Reverse DNS; 2 MB cap per HTML/CSS/JS file (64 MB PDF)
BingbotBing Search & Copilot groundingYes (Edge engine), warns against CSR-only copyHonoredReverse DNS; warns against heavy JS subrequests
ApplebotSiri, Spotlight, Safari, Apple IntelligenceYes (if JS/CSS unblocked)HonoredReverse DNS (*.applebot.apple.com); blocked assets stop rendering
OAI-SearchBot / GPTBot / ChatGPT-UserChatGPT search, training, live user fetchesNo (11.50% JS fetch rate, zero run in Dec 2024 study)Honored by search/training bots; live user fetch may bypassPublished IPs (searchbot.json, gptbot.json, chatgpt-user.json)
ClaudeBot / Claude-SearchBot / Claude-UserAnthropic training, search, live user fetchesNo for ClaudeBot (23.84% JS fetch rate, zero run)Honored (also reads Crawl-delay)Anthropic IP list; specific bot rules override *
PerplexityBot / Perplexity-UserPerplexity search index & live user fetchesNo (raw HTML parser only)Honored by PerplexityBot; user fetch generally bypassesPublished IPs (perplexitybot.json, perplexity-user.json)
CCBotCommon Crawl open pretraining datasetNoHonoredRaw HTML capture without browser engine
facebookexternalhit/1.1 & Meta-WebIndexerMeta link previews & AI citation indexingNo (static <head> parser)Meta-WebIndexer honors rules; preview/user fetchers may bypassPartial fetch via Range: bytes=0-524288 (512 KiB)
Slackbot-LinkExpanding 1.0Slack link unfurlingNo (static <head> parser)Ignores robots.txt for shared linksHTTP Range fetch from document start; ~30-minute cache

Why AI Crawlers Skip Headless Rendering

Running Chromium on every web request costs far more compute and memory than parsing plain HTML.

In July 2025, Cloudflare crawl-to-click data measured huge gaps between how often bots scrape pages and how often they send a visitor back:

  • 38,065:1 for Anthropic
  • 1,091:1 for OpenAI
  • 195:1 for Perplexity
  • 40.7:1 for Microsoft

With ratios above 1,000 crawls per click, AI operators keep ingestion cheap by reading static HTTP responses directly.

Retrieval pipelines also discard most of a fetched page before generating an answer, keeping only concise top passages when structuring content for AI search. If your server sends a 2 KB CSR shell with zero body text, nothing enters that extraction step.

Even JS-Capable Bots Warn Against Client-Only Content

Bingbot and Applebot can both run JavaScript, yet neither treats client-only pages as safe.

Microsoft’s Bing Webmaster Guidelines warn against “hiding critical content behind client-side rendering” and triggering too many HTTP requests just to draw a page. Pages that fail to render reliably can drop out of Bing Search and Copilot, a problem covered years earlier in Microsoft’s Bingbot JavaScript series.

Apple’s Applebot documentation notes the same dependency risk. If robots.txt blocks a script or stylesheet, or a subresource stalls, Applebot cannot finish browser rendering. Putting main copy in initial HTML keeps Siri and Spotlight indexing reliable.

How Browsers Use Initial HTML Before Scripts Load

Initial HTML is not only a bot requirement. It directly controls browser speed and Core Web Vitals.

Modern browsers parse incoming HTML as a byte stream using WHATWG HTML parsing rules. At the same time, a speculative preload scanner reads ahead through raw HTML bytes whenever the main parser pauses on CSS or scripts.

If your server sends real <img>, <link>, and text tags immediately, the preload scanner starts downloading hero images and fonts right away.

If you send an empty SPA shell, the preload scanner finds nothing. The browser gets stuck waiting through five serial steps:

  1. Wait for Time to First Byte (TTFB) of the empty HTML file.
  2. Download the main JavaScript bundle.
  3. Wait for V8 to scan, compile, and run that bundle on the main thread.
  4. Wait for client fetch() API calls to return page data.
  5. Insert the hero <img> into the DOM, only then starting the image download.

In the LCP breakdown model, that extra wait inflates Resource Load Delay. Large type="module" bundles also trigger long script evaluation tasks in V8 that delay user clicks and hurt Interaction to Next Paint (INP). Keeping individual JS chunks near 100 KB helps keep main-thread blocks short.

Downstream in Chromium’s Blink engine, LayoutNG uses immutable fragment trees to make page layout fast and predictable. But LayoutNG cannot compute final box geometry until DOM nodes exist. Injecting cards or banners after first paint causes avoidable Cumulative Layout Shift (CLS).

Five Real Initial-HTML Failure Modes (and Exact Code Fixes)

These five failure patterns break initial HTML on production sites. Each includes the broken pattern and the working fix.

Many teams use Server-Side Rendering (SSR) and still get blank preview cards in Slack, WhatsApp, LinkedIn, or Facebook.

Meta’s Web Crawlers specification tests previews with Range: bytes=0-524288 (512 KiB), and Slack’s unfurler documentation pulls only the smallest starting byte range needed to find Open Graph tags.

If your template puts huge inline <style> blocks, inline <svg> icon sprites, or JSON blobs before <meta property="og:*">, partial fetches stop before reaching your metadata.

Broken <head> byte order:

<head>
  <meta charset="utf-8" />
  <!-- 75 KB of inlined CSS + inline SVG sprite sheet -->
  <style>/* ...thousands of utility rules... */</style>
  <svg style="display:none"><!-- ...200 icons... --></svg>
  <!-- Partial range fetch may stop before reaching these tags -->
  <title>Pricing | Example App</title>
  <meta property="og:title" content="Pricing | Example App" />
  <meta property="og:image" content="https://example.com/og/pricing.png" />
  <link rel="canonical" href="https://example.com/pricing/" />
</head>

Fixed <head> order (metadata inside the first 16 KiB):

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Pricing | Example App</title>
  <meta name="description" content="Transparent monthly plans with zero per-seat markup for growing teams." />
  <link rel="canonical" href="https://example.com/pricing/" />
  <meta property="og:type" content="website" />
  <meta property="og:title" content="Pricing | Example App" />
  <meta property="og:description" content="Transparent monthly plans with zero per-seat markup for growing teams." />
  <meta property="og:image" content="https://example.com/og/pricing.png" />
  <link rel="stylesheet" href="/assets/main.css" />
</head>

Keep your title, canonical link, robots tag, and Open Graph metadata in the first 4 to 16 KiB of the document, ahead of inline styles and scripts.

2. Soft-404 Fallbacks Polluting AI Crawl Budgets

Under RFC 9110 HTTP semantics, status codes (200 OK, 301 Moved Permanently, 404 Not Found) tell bots whether a URL exists before they read HTML.

In the Vercel and MERJ study, ChatGPT bots wasted 34.82% of requests on 404 URLs and Claude bots wasted 34.16%, versus 8.22% for Googlebot. When an SPA server rewrites missing paths to index.html with 200 OK, non-JS crawlers cannot tell a broken URL from a real page and index empty shells.

Broken Nginx SPA catch-all:

location / {
  # Sends 200 OK + /index.html even for typos and deleted slugs
  try_files $uri $uri/ /index.html;
}

Fixed static or SSR routing (real 404 before streaming body):

location / {
  try_files $uri $uri/ =404;
}
error_page 404 /404.html;

Also return real noindex directives on initial HTML when blocking pages: Google’s JavaScript SEO rules ignore JavaScript attempts to remove an initial-HTML noindex because WRS skips rendering blocked 200 pages.

3. Client-Injected Canonicals and JSON-LD Schema

Teams often update <title>, <link rel="canonical">, or <script type="application/ld+json"> inside a client component (useEffect or client-only helmet wrappers).

Googlebot can pick up client-injected JSON-LD in Wave 2, though it still creates risk if rendering stalls. Non-JS crawlers never run that script, so they index either no schema or the wrong default canonical from your root template.

Broken client-only metadata (useEffect):

"use client";
import { useEffect } from "react";

export function ProductSeo({ canonicalUrl, jsonLd }: Props) {
  useEffect(() => {
    document.head.insertAdjacentHTML(
      "beforeend",
      `<link rel="canonical" href="${canonicalUrl}">`
    );
  }, [canonicalUrl, jsonLd]);

  return null;
}

Fixed server-emitted metadata and schema:

// Rendered on the server (Next.js Server Component, Astro frontmatter, or SSR template)
export default function ProductPage({ product }: { product: Product }) {
  const jsonLd = {
    "@context": "https://schema.org",
    "@type": "Product",
    name: product.name,
    url: `https://example.com/products/${product.slug}/`,
  };

  return (
    <main>
      <h1>{product.name}</h1>
      <p>{product.summary}</p>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
      />
    </main>
  );
}

Render canonicals, <title>, and JSON-LD directly during HTML generation.

4. Hydration Bloat Past 2 MB and Deployment Skew

Even Googlebot enforces a strict cap, crawling only the first 2 MB of HTML, CSS, and JavaScript (64 MB for PDFs). Anything beyond 2,097,152 bytes gets cut off.

Passing raw database rows into __NEXT_DATA__ or React Server Component flight scripts can swell initial HTML past 2 MB, slicing off footer navigation links or trailing JSON-LD before </body>.

Delayed JavaScript execution also triggers deployment skew. Googlebot or Bingbot can fetch your HTML today and run scripts weeks later. If a deploy deleted /assets/app.a1b2c3.js, Wave 2 receives 404 for your bundle and renders nothing.

How to prevent both failures:

  • Pass only fields the UI renders to client props (trim audit trails, raw markdown arrays, and unused CMS metadata).
  • Keep previous hashed static assets on your CDN or enable skew protection for at least 14 to 30 days.
  • Emit primary content in HTML so a missing hydration chunk never wipes out the text.

5. Interaction-Hidden Content and Click-Only Navigation

Both Googlebot and AI bots inspect static page state. Neither clicks tabs, expands accordions to trigger fetch(), or scrolls infinitely to load page 2.

Broken click-only navigation and lazy tab fetch:

<button onclick="navigateTo('/pricing')">Pricing</button>
<div id="specs-panel" onclick="fetchSpecsAndRender()">Click to load specs</div>

Fixed HTML-first links and visible semantic markup:

<a href="/pricing/">Pricing</a>
<details open>
  <summary>Technical Specifications</summary>
  <p>Supports HTTP/2, Brotli compression, and server-rendered JSON-LD.</p>
</details>

Keep interactive enhancements in JavaScript, while keeping the links (<a href>) and core specification text in initial HTML.

What Belongs in Initial HTML vs. Client JavaScript

You do not need zero JavaScript. You only need to separate discovery and core meaning from interactive UI state.

Content TypeMust Live in Initial HTML?Safe to Enhance with JS?Why
<title>, canonical, meta description, Open GraphYes (first 16 KiB)NoSocial unfurlers use partial HTTP Range fetches and skip JS
<h1>, headings, main article or product copyYesOnly minor formattingAI bots (GPTBot, ClaudeBot, PerplexityBot) parse raw HTML only
Primary navigation, pagination, breadcrumb <a href> linksYesClient-side router transitions OKCrawlers discover URLs directly from initial HTML href attributes
JSON-LD structured dataYes (strongly recommended)Fallback onlyAI search and rich-result extractors read static <script type="application/ld+json">
Pricing tables, FAQs, specs, author bylinesYesTab/accordion state toggles OKClick-to-fetch APIs vanish for bots that never interact
Search filters, calculators, live chart tooltips, auth dashboardsInitial default state if publicYesInteraction-driven tools benefit from JS after public summary loads

Stack Playbook: Practical Rules by Framework

Different stacks break initial HTML in predictable ways:

  • Astro / static site generators: HTML-first by default. Keep headings, prose, links, and schema in .astro templates, and scope interactive islands (client:visible or client:idle) only to widgets like calculators or comment forms, as detailed in our guide to SPA answer-engine islands.
  • Next.js (App Router): Keep route pages and generateMetadata() on the server. Putting "use client" on a page wrapper or loading main copy inside useEffect throws away server HTML benefits. Keep streamed Suspense boundaries from hiding core above-the-fold copy behind generic loading spinners for bots that do not wait for client fallbacks.
  • Vite / React SPAs: Enable static prerendering (vite-ssg or build-time route prerendering) for public marketing, docs, and blog routes, and configure explicit 404 edge rules so bad slugs do not return 200 OK.

If you manage crawl permissions across different bot types, pair clean initial HTML with per-agent directives covered in our AI crawler robots.txt guide, keeping rules well inside Google’s 500 KiB robots.txt cap. Also keep in mind that live user fetchers (ChatGPT-User, Perplexity-User, Meta-ExternalFetcher) are documented by OpenAI, Perplexity, and Meta as sometimes ignoring robots.txt, so edge WAF rules govern access while initial HTML governs readability.

Reproducible Verification Workflow (Copy-Paste Toolkit)

DevTools’ Elements tab shows the DOM after JavaScript runs, not what initial-HTML consumers receive. Run these four command-line checks against your staging or production URLs instead.

1. Multi-Bot Initial HTML & Status Audit

Save this script as audit-initial-html.sh to verify status codes, uncompressed payload size, body text presence, og:title, and canonical tags across seven real user-agents:

#!/usr/bin/env bash
set -euo pipefail

TARGET_URL="${1:?Usage: ./audit-initial-html.sh <https://target-url> <required-text-snippet>}"
REQUIRED_TEXT="${2:?Provide a distinctive body sentence to verify in raw HTML}"

AGENTS=(
  "Mozilla/5.0 (compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot)"
  "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.4; +https://openai.com/gptbot)"
  "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
  "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)"
  "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
  "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
  "Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)"
)

printf "%-25s | %-6s | %-10s | %-9s | %-8s | %-9s\n" \
  "Agent" "Status" "Bytes" "TextFound" "OG:Title" "Canonical"
printf "%s\n" "------------------------------------------------------------------------------------"

for ua in "${AGENTS[@]}"; do
  label=$(echo "$ua" | grep -oE '(OAI-SearchBot|GPTBot|ClaudeBot|PerplexityBot|bingbot|facebookexternalhit|Slackbot-LinkExpanding)' | head -n1)
  tmp_body=$(mktemp)
  status=$(curl -sSL --compressed -A "$ua" -o "$tmp_body" -w "%{http_code}" "$TARGET_URL")
  bytes=$(wc -c < "$tmp_body" | tr -d ' ')
  text_found=$(grep -qF "$REQUIRED_TEXT" "$tmp_body" && echo "YES" || echo "NO")
  og_found=$(grep -qiE '<meta[^>]+property=["'\'']og:title["'\'']' "$tmp_body" && echo "YES" || echo "NO")
  canon_found=$(grep -qiE '<link[^>]+rel=["'\'']canonical["'\'']' "$tmp_body" && echo "YES" || echo "NO")

  printf "%-25s | %-6s | %-10s | %-9s | %-8s | %-9s\n" \
    "$label" "$status" "$bytes" "$text_found" "$og_found" "$canon_found"
  rm -f "$tmp_body"
done

2. Check Exact Byte Offset of <meta property="og:title"> and 404 Behavior

Checking only whether og:title exists somewhere in HTML hides truncation bugs. Use grep -bo inside a 16 KiB byte-range request to confirm exact byte placement, and inspect a broken path to confirm zero soft-404s:

# 1) Measure byte offset of og:title inside the first 16 KiB
curl -sSL -H "Range: bytes=0-16384" \
  -A "Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)" \
  "$TARGET_URL" | grep -bo 'property="og:title"'

# 2) Confirm uncompressed HTML stays well below Googlebot's 2 MB (2,097,152 B) cap
curl -sSL --compressed "$TARGET_URL" | wc -c

# 3) Confirm an invalid route returns real 404 headers instead of 200 OK
curl -sI "https://example.com/non-existent-route-check/" | head -n 3

Testing these exact commands against this site’s live static pages on December 2, 2026 confirmed status=200 with 167,642 bytes (0.47s TTFB) for OAI-SearchBot/1.0, property="og:title" appearing at byte 1188 (under 1.2 KiB from document start), and HTTP/2 404 on nonexistent routes.

Quantify how many <a href> links exist only after JavaScript runs:

RAW_HTML=$(curl -sSL --compressed "$TARGET_URL")
RENDERED_HTML=$(chromium --headless --dump-dom "$TARGET_URL" 2>/dev/null)

echo "Raw <a href> count:      $(printf '%s' "$RAW_HTML" | grep -oi '<a [^>]*href=' | wc -l)"
echo "Rendered <a href> count: $(printf '%s' "$RENDERED_HTML" | grep -oi '<a [^>]*href=' | wc -l)"

If rendered links greatly outnumber raw links, non-JS crawlers cannot traverse your internal graph.

4. Validate Real Bot Visits in Origin Logs

CDN bot-management filters often challenge curl commands that claim a bot User-Agent from a developer laptop IP. Confirm real crawler hits in CDN or origin access logs using published verification ranges:

Symptom-to-Fix Troubleshooting Reference

Observed SymptomLikely Root CauseHow to ConfirmConcrete Fix
Ranks in Google, invisible in ChatGPT/Claude/PerplexityCore prose or JSON-LD injected by client JSTextFound = NO in OAI-SearchBot curl testRender prose and schema via SSR or SSG
Blank or unstyled link preview in Slack/WhatsApp/LinkedInInline CSS/SVG/JSON pushed og:meta past range window, or OG tags injected via JSRun Range: bytes=0-16384 grep -bo checkMove <title>, canonical, and og:* tags into the first 16 KiB of <head>
Missing pages show up in AI crawler logs as 200 OKSPA fallback index.html serving soft-404scurl -sI on bad slug returns HTTP/2 200Emit real 404 or 301 status before streaming HTML
Google Search Console reports 404 on /_next/static/...jsDeployment skew between Wave 1 fetch and Wave 2 renderCompare script hashes in old crawl logs vs current buildEnable skew protection or keep old static assets 14 to 30 days
Footer links or schema ignored on huge SSR pagesSerialized hydration JSON pushes document past Googlebot’s 2 MB capcurl -sSL --compressed URL | wc -c exceeds 2,097,152Trim serialized state blobs to visible UI fields only
Slow LCP despite fast TTFB on SPA routesBrowser preload scanner sees empty shell and stalls on JS waterfallDevTools Performance / Network waterfall shows fetch() before LCP imageStream or pre-render initial <h1> and LCP <img> tags in HTML

Common Questions

Do ChatGPT, Claude, and Perplexity execute JavaScript?

No major evidence of JavaScript execution appeared in the December 2024 Vercel and MERJ crawler study of GPTBot, ClaudeBot, or PerplexityBot. While some bots download .js asset files, they read only the raw initial HTML response to index text and extract citations.

If Googlebot runs JavaScript, why should I care about initial HTML?

Googlebot is the exception, and even Googlebot enforces a 2 MB per-file cap and suffers from delayed Wave 2 rendering and deployment skew. AI search bots, Meta and Slack link unfurlers, and your browser’s speculative preload scanner all depend on complete initial HTML.

Link previews fail for two initial-HTML reasons: either JavaScript inserts the <meta> tag after load, or bulky inline <style> tags and hydration data push <meta property="og:image"> beyond the partial HTTP Range window used by Slack and Meta (512 KiB). Put Open Graph tags inside the first 16 KiB of <head>.

Does moving critical content into initial HTML mean removing all JavaScript?

No. Keep rich interactive filters, calculators, and logged-in UI state in JavaScript islands or client components while emitting headings, main prose, prices, JSON-LD, and <a href> links from the server.

How can I check in 10 seconds what non-Google bots see on my page?

Run curl -sSL -A "OAI-SearchBot/1.0" YOUR_URL | grep -oE '<h1|<p|og:title' or check View Page Source in your browser. Never use the DevTools Elements tab for this check, because Elements reflects the DOM after JavaScript executes.

Sources & Further Reading

Official Crawler & Platform Documentation

Protocol Specifications & Browser Internals

Empirical Studies & Traffic Telemetry

Written by

Platform Engineer and Technical Writer with 10+ years of full-stack development experience and 2+ years focused on DevOps and platform engineering.

Need help implementing this?

Technical SEO & Core Web Vitals Audits

Fix slow loading pages, broken links, and indexing issues in your code so more people find your products and content. View a sample audit.

Related posts

Try: