Safeguard
Developer Tools•

Is your JavaScript docs site crawlable? A checklist

Check rendering, real links, status codes, canonicals and structured data on a single page app docs site, using Google's JavaScript guidance.

Safeguard Security Team
3 min read

Google can render JavaScript, but a docs site built as a single page app has specific traps: links that are not anchors, error pages that return 200, and metadata that changes late. Check five things: real links, real status codes, initial HTML, stable metadata and rendered content.

How Google processes JavaScript

Google's documentation describes three phases: crawling, rendering and indexing. Googlebot checks robots.txt before fetching, and does not render pages it is blocked from. Pages with a 200 status go into a rendering queue where headless Chromium runs the scripts, then Google parses the rendered HTML for links and content. Google still recommends server side or pre rendering for speed and for bots that cannot run JavaScript.

The checklist

1. Links are anchors. Google only discovers links that are a elements with an href attribute. Fragment routes such as a hash followed by a path are not reliably resolved. Use the History API with real URLs. The crawlable links guidance adds that onclick only elements and javascript: URLs are not recommended.

2. Errors return real status codes. Client side routing cannot return a 404 by itself. Google suggests redirecting to a server URL that returns 404, or injecting a noindex robots meta tag on error views. See redirects and status codes.

3. Canonical is in the HTML. Prefer the initial HTML. If JavaScript sets it, use the same value and keep only one canonical tag.

4. Do not rely on scripts to remove noindex. Google may skip rendering when it sees noindex, so JavaScript that removes it may never run.

5. Titles and descriptions are unique. They can be set with JavaScript, but each page needs its own.

Extra pitfalls from the same guidance

  • Use content fingerprinting in filenames, since Google's rendering service may ignore caching headers.
  • Structured data can be injected with JavaScript. Test it.
  • Web components: only content visible in the rendered HTML gets indexed.
  • Follow lazy loading guidelines so content still gets indexed.

How to test one page

  1. Open Search Console's URL Inspection tool and view the rendered HTML.
  2. Confirm the headline, first paragraph and links appear in it.
  3. Disable JavaScript in a browser and load the page. If the answer is gone, consider server rendering the docs.

Why it matters beyond Google

Google notes pre rendering helps bots that cannot run JavaScript. Other crawlers vary and I did not verify how each treats scripts. Server rendered docs are the safer default for any reader or retrieval system.

Quick check

Is a hash route like /#/install OK?

Google's guidance says fragment based routing is not reliably resolved. Use real URLs with the History API.

Does a 200 response mean the page will be indexed?

No. Google says a 2xx status does not guarantee indexing.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.