Make JavaScript content crawlable
Google renders JavaScript, but rendering costs time and AI retrieval systems often read raw HTML. Server-render primary content, keep titles and links in the initial response, and avoid gating content behind interactions. Verify by curling the URL and by loading it with JavaScript disabled.
Why this matters
If the raw HTML is empty, some crawlers and assistants see nothing.
Before you start
- Access to the application rendering model
How to apply it
Check what the first response contains
Run curl on a content URL and search for the main heading, body text and primary links. An empty shell with only script tags confirms client-only rendering.
Check: curl -s your production domain/page contains the page H1 text without executing JavaScript.
Move content to the server
Render content routes with SSG or SSR. Keep metadata in the server response. Hydrate only interactive parts, and pass server data as props.
Check: The rendered response contains the full article body and navigation anchors.
Verify rendering with URL Inspection
Inspect the URL and open the rendered HTML panel. Confirm the content is present and no resources are blocked.
Check: URL Inspection's rendered HTML contains the same H1 and body text as the browser view.
Source: seo-mcp playbook · curated entry · report an error
Framework notes
nextjs-app
Prefer server components for content and static generation for routes; avoid `use client` at the page root and move interactivity into leaf components.
astro
Astro ships zero JavaScript by default; use `client:load` only on interactive islands so content stays in the static HTML.
nuxt
Enable SSR or prerendering for content routes in `nuxt.config.ts`; `useAsyncData` on the server puts fetched content into the HTML payload.