React fix guide
How to fix soft 404 errors on a React site
A soft 404 means a page says "not found" to visitors but tells Google everything is fine. React single page apps do this by default, and the fix is to make the server send a real 404 status.
If Search Console lists "Soft 404" under Page indexing, Google has looked at a URL, seen a page that reads like an error or an empty page, and noticed the server answered with status 200 (OK). On a React site this is common and usually easy to explain, though the fix depends on how your site is built and hosted.
Why React causes soft 404s
A typical React app (Vite, Create React App, or similar) is one index.html file plus JavaScript. Your host is set up to send that same file for every path, so that routes like /pricing work when someone opens them directly. The side effect is that /this-page-does-not-exist also gets index.html with status 200. React Router then shows your "Page not found" component, but the status code has already been sent. React itself cannot change the HTTP status after the fact.
The same thing happens with empty states: a product page for an item that was removed, or a category with no results, that loads fine but shows "Nothing here".
Step by step
- Find the affected URLs. In Google Search Console open Indexing, then Pages, and click the "Soft 404" reason. Export the list.
- Check what the server really returns. For each sample URL, run
curl -I https://example.com/some-urland read the first line. If it says200but the page shows an error message, you have confirmed the problem. You can also use URL Inspection in Search Console. - Sort the URLs into two groups. Pages that should exist but are thin or empty (fix the content or data), and pages that should not exist (they need a real 404, or a 301 redirect if there is a close replacement).
- Make missing pages return a real 404. Pick the option below that matches your setup.
- Ask Google to re-check. Open the Soft 404 issue in Search Console and click Validate Fix. It can take a couple of weeks.
Option A: use server rendering (best fix)
If your React site runs on a framework that renders on the server, you can send the correct status from code.
- Next.js: call
notFound()fromnext/navigationin the App Router, or return{ notFound: true }fromgetStaticPropsorgetServerSidePropsin the Pages Router. Add anot-foundfile (App Router) orpages/404(Pages Router) for the design. Note that with streamed responses the status may already be sent, so test withcurl -Irather than assuming. - Remix and React Router framework mode: throw
new Response(null, { status: 404 })from a loader when the record does not exist.
This is the most reliable approach because the status is correct before any JavaScript runs.
Option B: keep a plain single page app
If you do not want to move to a framework, you have two honest workarounds.
1. Send the status from the server for known bad paths. If your host lets you list valid routes, answer everything else with 404. A simple nginx example for a dedicated error URL:
location = /not-found {
default_type text/html;
return 404 "<h1>Page not found</h1>";
}
In your React code, when a route or API lookup fails, send the visitor to /not-found with window.location.replace('/not-found'). Google's own guidance for single page apps accepts a JavaScript redirect to a URL that returns a real 404.
2. Add a noindex tag on the not found view. In the component that renders for unknown routes, set <meta name="robots" content="noindex">. React 19 can place a <meta> tag in the head directly; on older versions people use the well known react-helmet-async library. This is weaker than a real 404 because Google must run your JavaScript to see it, but it stops the pages being indexed.
Check your host's rewrite rule too. A line like /* /index.html 200 on Netlify, a catch-all rewrite in vercel.json, or try_files $uri /index.html in nginx is what turns every bad URL into a 200. You usually need it for routing, so do not delete it blindly: test your routes after any change.
Empty and thin pages
Not every soft 404 is a missing URL. If a real page loads its content from an API after the first render, Google may see an empty shell. Make sure the main content appears quickly, that API errors do not leave a blank "No results" view, and that truly empty listings either carry useful text or return a 404 or noindex.
Check your work
After deploying, request a made up URL with curl -I and confirm you now see 404. Then confirm real pages still return 200, and that no important page was redirected to the home page (Google also treats those as soft 404s). If you have chains of redirects while cleaning up, see redirect chains on React. For pages Google found but chose not to index, read crawled, currently not indexed on React.
SiteMonday's week 6 broken links and 404 sweep looks for this kind of problem and lists it in your ranked fix list, but the change itself has to be made by you or your developer. For the general explanation that applies to any platform, see soft 404 errors.
Not on React? Read the general guide to soft 404 errors, or the guide for WordPress, Shopify, Next.js, Magento, WooCommerce, Drupal.
Questions
Can React itself return a 404 status?
No, React running in the browser cannot change the HTTP status. The status must come from the server, which is why frameworks with server rendering such as Next.js or Remix can do it and a plain single page app cannot on its own.
Is a noindex tag enough to fix soft 404s?
It usually stops the pages from being indexed, but it is a workaround. A real 404 status from the server is clearer to Google and does not depend on JavaScript being run.
Should I redirect all missing pages to my home page?
No. Google tends to treat redirects to unrelated pages as soft 404s too. Redirect only when there is a close replacement, and otherwise return a 404.
Why does my product page show as a soft 404 when it loads fine?
Often the data loads after the first render, so Google sees an empty or "not found" view. Render the main content sooner, or return a real 404 when the product no longer exists.
Does Create React App or Vite make a difference?
Both build a single page app, so both behave the same way by default. The fix comes from your hosting rules or from moving to a server rendering framework, not from the build tool.