Stop redirecting your 404s to the homepage

A page goes missing, and someone decides a 404 looks bad. So every unknown URL now redirects to the homepage, or the site shows a friendly error page with a 200 status. Both feel tidier than an error. Both are worse for search than the error you were trying to hide.

What a soft 404 is

A soft 404 is a URL that tells visitors the page doesn't exist while telling crawlers everything is fine. Google's 2008 post on soft 404s describes them as returning a 200 response code for a page that doesn't exist, and calls the result confusing for users and search engines. Crawlers can spend their time on non-existent, often duplicate URLs, and your real pages may be found more slowly or visited less often.

Google's HTTP status code documentation says that when a page's content suggests an error, such as an empty page or an error message, Search Console shows a soft 404. Its crawl budget guide adds that soft 404 pages will continue to be crawled and waste your budget.

Why the homepage redirect counts too

A redirect to the homepage looks like a different case, because the status is a 301, not a 200. Google's documentation lumps it in anyway. Its 2011 post on 404s names a site that redirects any unknown URLs to its home page instead of returning 404 as something that can hurt how Google understands and indexes the site. Its site move guide says not to redirect many old URLs to one irrelevant destination such as the home page, because that might be treated as a soft 404.

It's bad for the person who clicked, too. They asked for something specific and landed on your front page with no explanation, so they can't tell whether the page moved, died, or never existed.

A 404 is not a penalty

The fear behind all this is that 404s hurt rankings. The 2011 post says a 404 on its own doesn't hurt you or count against you in search results, and that missing URLs don't affect the rest of your site. The status code documentation says indexed URLs that return a 4xx are removed from the index and crawled less often over time. For a page that's gone, that's exactly what you want.

404 or 410? For Google it doesn't matter. The 2011 post says Google treats 410 the same as 404, and the status code documentation says all 4xx errors except 429 are treated the same. Pick either.

When a 301 is right

Redirect when there's a real equivalent. The 2011 post gives two cases: a misspelled URL that people link to, which you can 301 to the correct one, and content that moved, where you 301 the old URL to the new one. The site move guide adds a third: if you merged several pages into one, you can redirect the old URLs to that consolidated page.

My test is whether someone who wanted the old page would be satisfied by the new one. A discontinued product redirected to its direct replacement passes. The same product redirected to the homepage, or to a category with nothing like it, doesn't. For pages that are simply gone, the crawl budget guide says to return 404 or 410.

The fix

  1. Check what your server says. Request a URL that never existed: curl -sI https://example.com/this-page-does-not-exist. You want a 404 or 410, not a 200 and not a 301 to /.
  2. Remove the catch-all redirect. Any plugin or server rule that sends every unknown path to the homepage has to go. Keep only the one-to-one redirects you chose on purpose.
  3. Make the 404 page useful. A clear "not found" message with search and a few links is fine, as long as the server sends a 404 status with it. The 2008 post says your server can return a 404 while still showing a helpful message.
  4. Map real moves to real pages. For old URLs with traffic or links, 301 each one to its closest true equivalent, in a single hop (chains have their own cost, which I covered in Your homepage has four addresses). The site move guide says to keep redirects for as long as possible, generally at least a year.
  5. Watch client-rendered sites. If your site routes in the browser, check that the server isn't answering 200 for paths that don't exist. Google's JavaScript SEO basics suggests a JavaScript redirect to a URL that returns a real 404, or a noindex robots meta tag on error pages. Client-rendered pages have other crawler problems as well.
  6. Read Search Console. It reports the URLs it treats as soft 404s. For each one, either return a real 404 or 410, or redirect it to a genuine equivalent.