New researchTechnical SEO & AI Search · 2027Explore the framework

SPA navigation SEO: make client-side routes crawlable

Audit single-page app navigation for real links, History API routes, direct URL loading, status codes and content that survives a fresh Googlebot visit.

Part of the JavaScript SEO series. For the full picture, start with JavaScript SEO: the complete rendering and indexing guide.

A single-page app can navigate perfectly for a person and still hide whole sections from crawling. The difference is usually in the link markup and what happens when someone opens a deep URL without first loading the homepage. SPA navigation SEO is an audit of routes, not a ban on JavaScript.

How do you make SPA navigation SEO-friendly?

Give every important page a distinct URL, a real <a href> link to that URL, and content that loads when the URL is requested directly. Google’s JavaScript SEO guidance recommends the History API for client-side routes and warns against using URL fragments to serve different page content. Its link guidance says anchors with href are the dependable format for discovery.

Navigation pattern Crawlability risk Better implementation
<button onclick="open('/shoes')"> No link URL to extract <a href="/shoes/"> with optional client routing
<a href="#/shoes"> Fragment represents app state, not a normal page URL History API path /shoes/
<a href="/shoes/"> Low, if destination loads directly Keep server fallback and content working

Client-side interception of an anchor click is fine for speed. Do not remove the anchor’s actual destination. This is narrower than the raw versus rendered HTML audit, which checks all content and SEO tags.

Why test a fresh load of every deep route?

Googlebot can request /products/trail-shoes/ without first visiting / and clicking through the app. The server or edge router must return the right response, and the app must derive the page from that URL without depending on prior in-memory state, cookies or local storage. Google’s JavaScript troubleshooting guide notes that its renderer does not retain browser storage state across page loads.

Copy a route into a private browser window or request it directly. Check its status, main heading, product or article text, canonical, meta robots, structured data and outbound links. Then repeat in Search Console URL Inspection for important examples. A route that works only after homepage navigation is not ready to be an indexable landing page.

What should happen on a missing SPA route?

Return a meaningful 404 when the route does not exist. Some client-rendered SPAs serve 200 for every path and show “not found” only after JavaScript runs. Google calls out this soft 404 pattern and documents fallback client-side approaches when a server 404 is impractical. Fixing the server response is usually clearer, while the soft 404 guide covers diagnosis.

Avoid changing a canonical from one URL in raw HTML to a different URL after rendering. Google’s JavaScript guidance recommends consistent canonical values. If the app shell sets one canonical for every route, all routes may point at the wrong page.

How do you audit SPA navigation at scale?

  1. Crawl from the homepage and export every discovered route. Compare it with the route list or XML sitemap to find pages no link reaches.
  2. Inspect navigation elements in rendered HTML. Confirm important destinations are anchors with href, not click-only controls.
  3. Request a sample of deep URLs directly, including a product, article, pagination page and missing route.
  4. Compare raw and rendered HTML for title, canonical, robots directive, primary content and links.
  5. Re-crawl after a router or template change, then inspect representative URLs in Search Console.

SPA navigation SEO checklist

  • Important views have stable, direct-loadable URLs
  • Navigation uses crawlable anchors with real href destinations
  • History API paths replace hash-only content routes
  • Deep routes render without prior session state
  • Missing routes return an intentional error or noindex behavior
  • Canonicals, titles and internal links match each route
  • A crawl can discover the same important pages as the sitemap

The useful test is simple: can a new visitor, and a crawler, reach the page from a link and load it cold?

Frequently asked questions

Can Google crawl a single-page app?

Yes, Google can render JavaScript, but it still needs discoverable URLs and accessible content. Test important routes with URL Inspection and a fresh direct load rather than assuming browser clicks prove crawlability.

Are JavaScript-inserted links crawlable?

They can be, provided they become ordinary anchor elements with valid href URLs. Google says links on spans, buttons or anchors without href are not reliably extracted.

Should an SPA use hash routes for indexable pages?

No. Google recommends History API routes rather than fragments such as #/products for different views. Give each indexable view a normal path that works when loaded directly.

What status should a missing SPA route return?

A missing page should not quietly return a 200 app shell that looks like an error. Google documents server 404 responses, or specific client-side handling to avoid soft 404s when server status control is impractical.

· Founder, Crawlens

Dien builds Crawlens, a desktop crawler for technical SEO audits, and writes about the checks it runs: crawling, indexing, rendering and Search Console data.

Audit your own site with Crawlens

Crawl, run 70 checks, and see them next to Search Console and Core Web Vitals data.

Download free for Windows