AHXSEO Labs

Soft 404s: when pages that don’t exist say “200 OK”

A missing page should tell search engines it is missing. When it answers "OK" instead, Google wastes time on it, may index it, and trusts your site a little less. Here is how to test for it and fix it.

Audit your site, freeCheck your own site for this, free

Every time a browser or a crawler asks your server for a page, the server answers with a status code before it sends anything else. 200 means "here it is". 404 means "there's no page here". 301 means "it moved, go there instead".

Visitors never see these codes. Search engines rely on them completely.

A soft 404 is a page that tells visitors it doesn't exist ("Sorry, we couldn't find that page") while telling search engines 200 OK. To Google, that's a real page with thin, repetitive content, and your site can end up with many of them.

Why it matters

  • Google wastes its visits. Every crawler has a limited number of requests it will make to your site. Time spent on pages that don't exist is time not spent on your new or updated ones.
  • Junk can get indexed. Google usually spots soft 404s and leaves them out, but not always. Some end up in search results, where a "page not found" is the worst first impression.
  • Broken links stay hidden. With a proper 404, tools (and Search Console) can tell you which links are broken. With 200, everything looks fine.

Test your own site in ten seconds

Ask your server for an address that can't exist and look at the status code:

bash
curl -s -o /dev/null -w "%{http_code}\n" https://yourdomain.com/this-page-does-not-exist-123

You want 404 (or 410). If you get 200, you have soft 404s. If you get 301 or 302 to your homepage, that counts too: Google treats "every missing page redirects to the homepage" as a soft 404.

Where they come from

  • Custom error pages set up the wrong way. The site shows a nice "not found" page, but the server sends it as a normal page.
  • Single-page apps. The server returns the same app shell (200) for every address, and JavaScript decides afterwards that the page doesn't exist.
  • "Redirect everything to home" plugins that were meant to avoid errors.
  • Empty search, tag or category pages that exist but show "no results".
  • Products that sold out or were removed but still answer with an empty template.

How to fix it

The goal: anything that doesn't exist answers 404 (or 410 if it's gone for good), and still shows your friendly error page to people.

WordPress sends a proper 404 by default. If yours doesn't, the cause is almost always a plugin that redirects missing pages, or a theme that loads a normal page template for errors. Disable redirect-to-home plugins and check again.

Next.js: call notFound() when the data for a page doesn't exist. It renders your not-found page with a real 404.

tsx
import { notFound } from 'next/navigation';

export default async function Product({ params }) {
  const product = await getProduct((await params).slug);
  if (!product) notFound(); // 404, not an empty page
  return <ProductPage product={product} />;
}

Other single-page apps: the server has to know which addresses exist. Either render the routes on the server, or have the server return 404 for unknown addresses while still sending the app.

Nginx / Apache: when you set a custom error page, point to it without changing the status (error_page 404 /404.html; keeps the 404). Don't use a redirect for this.

Removed products and pages: if there's a clear replacement, 301 redirect to it. If there isn't, let it 404. Redirecting to an unrelated page or the homepage doesn't help, and Google will usually treat it as a soft 404 anyway.

How AHX checks it

An AHX audit requests made-up addresses on your site and checks that they answer 404, and flags any crawled page whose title or heading says it's missing while it answers 200.

Written by

Ali Hassan

Founder, AHX Labs. Builds AHX SEO Labs, the site audit tool that crawls your site the way Google does and shows the fix for each problem.

Follow on LinkedIn

Discussion

Questions, corrections or your own experience: all welcome.