JavaScript SEO for Single-Page Applications: A Complete Guide

Josien Nation
Published on 
November 23, 2026

Your product team rebuilt the website as a single-page application. It feels fast, it looks great, and the developers love it. Then the marketing numbers come in: new pages take ages to show up in Google, some show the wrong title, and a few never get indexed at all.

That’s the classic JavaScript SEO problem with single-page applications. The short answer: Google can handle JavaScript, but only if your app gives it real URLs, real links, honest status codes and content it can see without clicking around. The long answer depends on how your app renders pages, and that’s what this guide is about.

I’ll explain how Google processes JavaScript, which rendering setup to choose, how to fix routing, errors and metadata, and how to test your own app in about 30 minutes. Let’s dig in.

What is a single-page application, and why is SEO harder?

A single-page application (SPA) is a website that loads one HTML shell and then uses JavaScript to build every view in the browser. When a visitor clicks a link, the app swaps content without loading a new page. That’s smooth for people, but search engines need extra work to see the content.

Frameworks like React, Vue and Angular made SPAs the default for many SaaS products and marketing sites. In a classic website, every URL returns a complete HTML page from the server. In a client-side rendered SPA, the server often returns an almost empty page, and the real content only appears after the JavaScript runs.

That creates three risks for SEO:

  • Content that arrives late. A crawler that reads only the first HTML response sees an empty shell.
  • Links that aren’t links. Navigation built with click handlers instead of real links gives crawlers nothing to follow.
  • Errors that look like success. A “page not found” view inside an SPA often comes back from the server as a normal, working page.

None of these risks is a reason to avoid SPAs. They’re reasons to build them carefully. If you’re new to the bigger picture, my overview of technical SEO ranking factors is a good starting point.

How does Google crawl and render JavaScript?

Google handles JavaScript pages in three steps: it crawls the URL, renders the page in a browser to run the JavaScript, and then indexes what it found. Rendering is the extra step. It happens in a queue, so content that depends on JavaScript can reach the index later than content in the HTML.

Google spells this out in its documentation. In its JavaScript SEO basics, Google says it processes JavaScript web apps in three main phases: crawling, rendering and indexing. If the difference between those steps is fuzzy, I explain it in this comparison of crawling, indexing and ranking.

The rendering step is where SPAs win or lose. Google says that once its resources allow, a headless Chromium renders the page and executes the JavaScript. A headless Chromium is a version of the Chrome browser that runs without a screen, on Google’s servers.

How long does a page wait? Google’s documentation says a page may stay on the render queue for a few seconds, but it can take longer than that. Ahrefs adds some detail in its JavaScript SEO guide: when Google looked into rendering delays, it found pages went to the renderer at a median time of five seconds, and the 90th percentile was minutes.

One more rule decides which pages get rendered at all. Google says Googlebot queues all pages with a 200 HTTP status code for rendering, unless a robots meta tag or header tells Google not to index the page. Keep that sentence in mind, because it comes back in the sections on errors and noindex.

Is client-side rendering bad for SEO?

Client-side rendering is not banned or penalized, but it’s the riskiest setup for search. All content depends on JavaScript running correctly, in a queue, on someone else’s servers. Server-side rendering, static rendering or prerendering put the content in the first HTML response, which removes most of that risk.

Colorful JavaScript code on a computer screen

Here’s how the main options compare. Rendering means turning code into the HTML a browser shows.

SetupWhere the HTML is builtGood fit for
Client-side rendering (CSR)In the visitor’s browserLogged-in app screens that don’t need to rank
Server-side rendering (SSR)On the server, for each requestPages that change often, like a large product catalog or docs
Static renderingAt build time, saved as filesMarketing pages, blog posts, landing pages
HydrationServer sends HTML, then JavaScript makes it interactiveMost public pages of a modern SPA

Ahrefs is blunt about the risk. Ahrefs says the most problematic setup is full client-side rendering, where all of the rendering happens in the browser. On the other side, Ahrefs says any kind of SSR, static rendering, and prerendering setup is going to be fine for search engines.

Google points the same way. Its JavaScript guide says server-side or pre-rendering is still a great idea because it makes a website faster for users and crawlers, and not all bots can run JavaScript.

You may have heard of dynamic rendering, where the server sends one version to bots and another to people. Google no longer wants you to start there. Instead of dynamic rendering, Google recommends server-side rendering, static rendering, or hydration as a solution.

My practical rule: every page you want to rank should arrive from the server with its main text, title, links and canonical already in the HTML. Keep pure client-side rendering for the screens behind the login. The speed side matters too, and my guide to Core Web Vitals explains how page experience is measured.

Every view in an SPA that should rank needs its own clean URL, and every link to it needs to be a real HTML link. Use the History API to change the URL, and avoid hash fragments such as /#/pricing. That way Google can discover each page, crawl it, and show the right URL in search.

Close-up of HTML code with links on a laptop screen

Routing is how an app maps a URL to a view. Old SPAs often used fragments, the part of a URL after the # sign. Google is clear that this doesn’t work for search: Google’s URL structure guidelines say not to use fragments to change the content of a page, as Google Search generally doesn’t support URL fragments.

The fix is built into every modern browser. For single-page applications with client-side routing, Google recommends using the History API to implement routing between different views of a web app. The History API lets JavaScript change the address bar to a normal path like /features/reporting without reloading the page.

Links need the same care. Google says it can only discover links if they are HTML anchor elements (the a tag) with an href attribute. A button or a div with an onClick handler can move a visitor to a new view, but Googlebot won’t treat it as a link.

A quick example. Say your navigation has a “Reporting” item. This version is crawlable: an anchor element with href=”/features/reporting”. This version is not: a span that calls router.push when someone clicks it. Most router libraries offer a Link component that outputs a real anchor element. Ask your developers to use it everywhere.

How do you handle 404 errors in a single-page application?

An SPA should tell Google when a page doesn’t exist. Because the server often returns a normal 200 response for every URL, a “not found” view can look like a real page, which Google calls a soft 404. Fix it with a redirect to a URL that returns a real 404, or a noindex tag on error views.

HTTP status codes are the three-digit numbers a server sends with every response. A 200 means “here’s the page”, a 404 means “this page doesn’t exist”. In a client-side rendered SPA, the server usually doesn’t know whether /features/old-thing exists, so it sends the app shell with a 200, and the app then shows an error message.

Google gives two ways out. To avoid soft 404 errors with client-side rendering and routing, Google suggests either a JavaScript redirect to a URL for which the server responds with a 404 HTTP status code, or adding a robots meta tag with noindex to error pages using JavaScript.

If you use server-side rendering, there’s a cleaner option: let the server check the route and return the right status code itself. That’s one more reason SSR makes SEO simpler.

How do you set titles, meta descriptions and canonicals in an SPA?

Titles and meta descriptions can be set with JavaScript, but the safest place for SEO tags is the HTML the server sends. Canonical tags should be in the HTML and never changed to a different value by JavaScript. A noindex tag in the HTML may stop Google from rendering the page at all.

Each view needs its own title and meta description, written for that page. Most frameworks have a helper for this. The risk comes when the HTML says one thing and the rendered page says another.

Canonical tags tell Google which URL is the main version of a page. Google says the best way to set the canonical URL is to use HTML, and if you have to use JavaScript, always set it to the same value as the original HTML.

Noindex is where SPAs get into real trouble. Google says that when it encounters the noindex tag, it may skip rendering and JavaScript execution, so using JavaScript to change or remove the robots meta tag from noindex may not work as expected. The reverse also bites. Ahrefs says that if you have an index tag in the raw HTML and a noindex tag in the rendered HTML, Google will treat it as noindex.

In plain words: decide indexing on the server. Don’t ship a noindex in the HTML and hope JavaScript removes it, and don’t let a JavaScript bug add one.

What does Googlebot not do when it renders a page?

Googlebot renders each page as a fresh visitor with no memory. It doesn’t keep local storage, session storage or cookies between page loads, and it declines permission requests such as location or notifications. Any content that only appears after a stored setting, a login or an accepted prompt is invisible to Google.

Google documents this in its troubleshooting guide. Google says its Web Rendering Service does not retain state across page loads: Local Storage and Session Storage data are cleared across page loads. The same page adds that you should expect Googlebot to decline user permission requests.

Here’s what that means for a typical SaaS site:

  • Personalized content. If your app shows feature content only after reading a saved preference, Google sees the default view.
  • Location prompts. A page that waits for a location permission before loading local content shows Google the waiting state.
  • Content behind interactions. Text that only loads after a click, a tab change or a scroll event may never be rendered.

The rule of thumb: whatever you want indexed must be on the page when it first loads, for a visitor who has never been there before.

What about other search engines and AI crawlers?

Google’s rendering ability is not a promise for every crawler. Other search engines and many other bots may read only the first HTML response. If your SPA needs JavaScript to show its content, those crawlers may see an empty page. Server-side or static rendering is the safest way to stay visible everywhere.

Google itself has been simplifying its advice. Search Engine Journal reported that Google updated its JavaScript SEO basics page on March 4, 2026, removing the section titled “Design for accessibility”. That section had suggested testing sites with JavaScript turned off.

Don’t read that as “JavaScript no longer matters”. Search Engine Journal notes that Google’s advancements to its own renderer don’t extend to other bots that might crawl your site, and other search engines and crawlers may not render pages the same way Google does.

This is my interpretation, not a documented rule from any AI company: if you care about showing up in AI assistants as well as in Google, plain HTML content is the safest bet. You don’t need to know how each crawler works when your important pages don’t depend on JavaScript to show their text.

How to test your single-page application in 30 minutes

You don’t need to be a developer to spot the big problems. This routine uses free tools and a normal browser, and it works best on five pages: your homepage, one feature page, one blog post, one docs page and a URL that shouldn’t exist.

Laptop with developer tools open while testing JavaScript SEO on a website
  1. View the raw HTML. Open each page, right-click and choose “View page source”. Search for a sentence from the main text. If it isn’t there, that page depends on client-side rendering.
  2. Check the rendered HTML in Google Search Console. Run the URL Inspection tool on each page, test the live URL and look at the rendered HTML and screenshot. My guide to using Google Search Console shows where to find it.
  3. Compare the tags. In both versions, check the title, meta description, canonical and robots meta tag. They should match.
  4. Test the fake URL. Visit a made-up address like /this-page-does-not-exist and check the status code in your browser’s developer tools (Network tab). You want a 404, or a noindex tag on the error view.
  5. Check the links. In the developer tools, inspect your main navigation. Every menu item should be an anchor element with an href.
  6. Check the URLs. Click through the site and watch the address bar. Each view should get a clean path, with no # in the middle.
  7. Write down what failed. Give the list to your developers, starting with pages that should rank and don’t have their content in the raw HTML.

If you’d rather have someone else go through every template and give you a prioritized fix list, that’s exactly what a technical SEO audit is for.

Common JavaScript SEO mistakes in SPAs

Most JavaScript SEO problems in SPAs come from a handful of habits. Each one is easy to fix once you know to look for it.

  • Rendering marketing pages on the client. The pages that need to rank are often the simplest ones. Static rendering is usually enough for them.
  • Using buttons for navigation. It looks the same to a visitor, but Googlebot can’t follow it. Use real anchor elements.
  • Returning 200 for everything. Old, deleted and mistyped URLs pile up as soft 404 errors and waste crawling on pages that shouldn’t exist.
  • Fixing tags with JavaScript after the fact. Titles, canonicals and robots tags that change after rendering send mixed signals. Put them in the server HTML.
  • Testing only in your own browser. Your browser has cookies, a login and permissions. Google has none of those. Test as a stranger.
  • Hiding content behind tabs that load on click. If the text isn’t on the page at load, treat it as missing.

Where to start this week

Start with the five-page test above. Pick the pages that matter most for signups, check whether their main text is in the raw HTML, and test one fake URL for the right status code. That gives you a short, specific list for your developers instead of a vague “fix our SEO” ticket. Then agree on one rule for every new page: content, links, title and canonical come from the server. Trust me, that one rule prevents most JavaScript SEO problems before they start.

Want help making your single-page application easy for search engines to read? Get in touch with me.


A note on how I write: I use AI tools as part of my writing process, for example to help with research, drafting, and a final check of spelling, grammar and punctuation. English isn’t my first language. I use it every day, at work and at home with my American husband, but I like a second pair of eyes on my writing. I review every article myself before it’s published, and every statistic links to its source.

Author

  • josien nation - web3 & crypto - seo specialist -

    Josien is a freelance SEO Consultant for crypto and web3 companies. With over 10 years of hands-on experience in online marketing of which 2 years within the blockchain industry, she helped crypto wallets, new blockchains, crypto and web3 consultants, and DAOs gain organic growth through SEO and content creation.

    View all posts

Reach out!

If you want to know more about me or what I can do for you, please reach out! You can message me directly here:
CONTACT >> 
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram