Technical SEO

JavaScript SEO and Rendering: What Crawlers Actually See

JavaScript SEO and rendering decide whether a crawler reads your content or just an empty shell. A client-side SPA can look perfect in a browser while the first HTML response contains almost nothing. I build WordPress and PHP sites at webdev-saif.com in Mymensingh, and I verify with view-source, curl and Search Console that the answer text, metadata and JSON-LD exist before hydration.

By Saif Al Jahanwebdev-saif.com

What JavaScript SEO and rendering actually means

JavaScript SEO is the practice of making sure the content a crawler needs is available in the response it fetches, not only after a browser executes your bundle. Rendering is the step that turns data into HTML: on the server, at build time, or in the browser. The two get conflated because a page can look complete to a person and still be invisible to a bot. A React or Vue route that fetches its copy in useEffect renders beautifully once the network call resolves; view-source shows a div with no text. I treat the raw response as the contract. If the title, H1, answer paragraph, canonical and JSON-LD are not in it, the page has not been published for crawlers, whatever the browser later paints.

  • Rendering location decides what exists in the first HTML response
  • view-source and curl reveal the pre-hydration document
  • A hydrated DOM is not the same thing as a crawlable document
  • Metadata and schema must exist before JavaScript runs

Why the first HTML response is the source of truth

Googlebot fetches a URL, parses the initial HTML, then queues the page for JavaScript rendering in a second wave using a headless Chromium. That second step is deferred and resource-limited, so an answer that lives only behind a client-side fetch can wait days to be indexed, or be missed when render budget is tight. Other crawlers never run the second step at all. The practical consequence is that the initial response is the only guarantee you have. I keep a plain anchor with an href for every internal link, put the answer-first paragraph directly in the template, and emit JSON-LD in the head during the server request. Anything injected after load is a bonus, never the foundation.

Client-side SPAs and the hydration gap

A client-side SPA ships a shell and a bundle; React, Vue or Angular then fetches data and paints the page. Hydration is the moment the framework attaches event listeners to that markup. The gap between first paint and hydrated DOM is where SEO problems live. If content arrives from a fetch call, a crawler that does not execute JavaScript sees the loading state. If the markup is generated by the bundle, the raw HTML has no H1 to read. I have seen product pages where the price, description and FAQ all came from a client-side API call, so the search snippet stayed blank. The fix is not to abandon the framework but to move the answer-bearing HTML upstream.

  • Shell-first SPAs deliver near-empty divs in view-source
  • Client-side fetches delay content until after the network call
  • Loading skeletons can be mistaken for the final page
  • Crawlers follow href anchors, not click handlers or pushState calls
  • Hydration errors can discard server markup during reconciliation

Rendering strategies ranked by crawl reliability

Server-side rendering runs the component tree on each request and returns finished HTML; it is the most predictable option because the answer is in the first byte. Static site generation builds each route once at deploy time, which is faster and just as crawlable when the content is stable. Incremental static regeneration and on-demand revalidation keep static pages fresh without a full rebuild, but they add build state you must monitor. Client-side rendering is the least reliable for discovery. Pre-rendering sits in the middle: a headless browser renders each route at build time and saves the HTML, which works well for a small catalogue. In my builds I prefer server-rendered templates or a pre-render step for anything expected to rank.

  • SSR: complete HTML per request, highest crawl confidence
  • SSG: HTML generated at build time, ideal for stable routes
  • ISR and on-demand revalidation: fresh static pages with a cache to manage
  • Pre-rendering: headless browser snapshot saved per route at build time
  • CSR: shell plus bundle, dependent on the crawler executing scripts

Why AI crawlers often see only the raw HTML

Search engines have a rendering queue; most AI crawlers do not. GPTBot, ClaudeBot and PerplexityBot fetch pages to train models or answer questions, and many of them parse the HTML they receive without running a full browser. If your article paragraph, product spec or FAQ answer is injected after hydration, those bots see only the raw HTML: the title, a shell, and a script tag. That is why a page can rank in Google yet never be cited by an answer engine. I put the answer-first paragraph and FAQ text in the server response, mirror them in JSON-LD, and check robots.txt so those crawlers are allowed in. Blocking them at the edge makes every other optimisation pointless.

  • Many AI bots do not execute JavaScript or wait for API calls
  • Answer text must be present in the raw response, not only in the DOM
  • JSON-LD emitted in the head is readable without a browser
  • robots.txt must allow GPTBot, ClaudeBot and PerplexityBot
  • An llms.txt summary gives answer engines a clean entry point

How I verify rendering in a real build

Verification starts with a request that runs no JavaScript at all. I fetch the URL with curl and read the raw HTML for the title, meta description, canonical, H1, answer paragraph and application/ld+json block. Then I open view-source and compare it with the rendered DOM; any text that appears only in the latter is a hydration dependency. In Search Console I run URL Inspection and look at the rendered HTML screenshot, then check the Rich Results Test for schema warnings. Crawl logs tell me whether bots are reaching the route at all. Finally I throttle a mid-range Android profile to keep LCP under 2.5s, INP under 200ms and CLS under 0.1, because a heavy bundle delays both rendering and interaction.

  • curl the URL and inspect title, canonical, H1 and JSON-LD in the raw response
  • Compare view-source with the rendered DOM to find hydrated-only text
  • Search Console URL Inspection: check the rendered HTML and screenshot
  • Rich Results Test: validate FAQPage and TechArticle markup
  • Crawl logs: confirm bot visits to public routes, not just the shell

When client-side rendering is acceptable

Client-side rendering is fine where discovery does not matter: logged-in dashboards, internal tools, and content behind authentication that no crawler should index. It is also acceptable when the same route has a server-rendered or statically generated public twin, so the crawlable version carries the answer and the app takes over after navigation. Problems start when marketing copy, pricing or documentation is trapped inside the bundle. For public pages I use one simple rule: the first response must stand on its own. Everything after hydration should enhance reading, not create it. That rule keeps Saif Al Jahan builds resilient when a crawler decides not to run JavaScript, which is increasingly the default rather than the exception.

Frequently asked questions

What is JavaScript SEO in simple terms?

JavaScript SEO makes sure the content a search engine or answer engine needs is present in the raw HTML response, not only after a browser runs your code. A page is only crawlable to the extent that its title, answer paragraph, internal links and structured data exist before hydration. If they appear only in the rendered DOM, some crawlers will never see them.

Does Google render JavaScript on client-side SPAs?

Yes, but as a deferred second step after the initial crawl, using a headless browser with a limited render budget. That delay can slow indexing and break content that depends on a client-side API call. Server-render or statically generate anything you expect to rank, and confirm it is in view-source rather than trusting the browser DOM.

Why do AI crawlers often see only the raw HTML?

Most AI crawlers fetch a page to read text, not to run a full browser. Bots such as GPTBot, ClaudeBot and PerplexityBot commonly parse the HTML they receive and skip JavaScript execution entirely. Any answer injected after hydration is invisible to them. Put the answer-first paragraph and FAQ text in the server response, emit JSON-LD in the head, and allow these bots in robots.txt.

What is a hydration gap?

It is the interval between the first paint of a server or shell response and the moment the framework attaches event listeners and takes control. If content, links or schema appear only during or after that step, a crawler that stops at the raw HTML misses them. In my builds the answer text and metadata are never dependent on hydration.

Is pre-rendering enough for good JavaScript SEO?

For a small, mostly static site, yes: a build-time browser snapshot gives crawlers finished HTML per route. It becomes fragile when content changes often, because stale snapshots keep old prices or copy. For frequently updated pages I prefer server-side rendering or on-demand revalidation, and I always check that the saved HTML contains the answer, canonical and JSON-LD.

Which rendering method should I choose for a new site?

Choose based on how often the content changes and who maintains it. Static generation suits stable pages, server-side rendering suits frequent updates, and pre-rendering suits a small catalogue. Avoid pure client-side rendering for public pages you want discovered. In my WordPress and PHP work the simplest reliable choice is a server-rendered template with schema emitted during the request.

Written by Saif Al Jahan, webdev-saif.com · Mymensingh, Bangladesh. Last updated .