Encited logo
Pricing

Soft 404 detection and signaling 404 pages

How Encited (formerly LovableHTML) detects soft 404s on prerendered pages, and how to explicitly mark your 404 page so crawlers receive a real 404 status.

What is a soft 404?

Single-page apps typically return HTTP 200 for every route, including ones that don't exist. The server always serves the same index.html, and the "Page not found" screen is rendered by JavaScript afterwards. Search engines call this a soft 404: the page says "not found" but the status code says "OK". Google Search Console reports these under "Soft 404", they waste crawl budget, and broken URLs can linger in the index as empty pages.

Encited fixes this at the prerendering layer. When a rendered page is detected as a 404, crawlers receive a real 404 status code instead of a 200. Human visitors are unaffected — they always get your SPA, which handles the not-found route the way it always has.

Automatic detection

A rendered page that returned 200 is flagged as a soft 404 when both of these are true:

  • The page title or visible text contains common not-found wording (a standalone "404", "page not found", "doesn't exist", and similar).
  • The page carries a noindex robots meta tag, such as <meta name="robots" content="noindex">.

Both signals are required on purpose. Wording alone would misfire on real pages that merely mention 404s — a blog post about error pages, a product name containing "404". If your not-found route already sets noindex, which most SPA frameworks make easy, detection just works.

If your not-found route doesn't set noindex, or you want detection to be deterministic instead of heuristic, add this meta tag to that route:

html
CopyDownload
<meta name="prerender-status-code" content="404">

Crawlers will receive a 404 status for that URL. Use content="410" instead if the page is permanently gone and you want a 410.

Example with react-helmet-async:

jsx
CopyDownload
import { Helmet } from "react-helmet-async";
function NotFoundPage() {
return (
<>
<Helmet>
<meta name="prerender-status-code" content="404" />
</Helmet>
<h1>Page not found</h1>
</>
);
}

Important: Only render this tag on your not-found route. If it ends up on every page (for example in a static index.html), every prerendered page will be served to crawlers as a 404.

This is the same convention used by other prerendering services, so if you're migrating and your app already sets prerender-status-code, it keeps working without changes.

Avatar
How can we help?
Get instant answers to your questions or leave a message for an engineer will reach out
Ask AI about Encited
See our docs
Contact support
Leave a message
We'll get back to you soon
Avatar
Ask AI about Encited
Team is also here to help
Thinking
Preview
Drop an image to attach
Powered by ReplyMaven