Skip to content

"Not found (404)" in Search Console: which addresses to fix on a WordPress site, and which to leave

"Not found (404)" lists addresses that answered 404 when Google asked for them. Most never were pages or were removed on purpose, and Google's help says such 404s do no harm. Only two kinds need work: a page that moved, which needs a redirect, and a page that should exist.

By
WP Ministry
Published
Tested on
WordPress 7.1.3, PHP 8.3.35

In short

  • A 404 is the correct answer for an address that never was a page, or for a page you removed with nothing in its place. Google's help says 404s do not harm a site's indexing or ranking.
  • Sort the list into four kinds. Never a page and removed on purpose need nothing. Moved needs a 301 redirect. Should exist needs the page back.
  • The report shows what Google met at its last crawl. Ask each address what it answers today before you change anything.
  • WordPress answers some missing addresses with a 301 to a post whose slug begins the same way, so a removed page may not answer 404 at all.
  • Do not send every 404 to the home page, block the addresses in robots.txt, or serve a "not found" message with a 200.
  • The report lists only addresses that answered 404 in the past month. Google keeps trying a known address for some time, less and less often.

"Not found (404)" in Search Console's Page indexing report is a list of addresses on your domain that answered 404 when Google asked for them. For most of them that is the right answer. An address that never was a page, or a page you removed with nothing in its place, should answer 404, and Google's help for this status says a 404 is not necessarily a problem when a page was removed without a replacement. Two kinds do need work: a page that moved, which needs a redirect from its old address, and a page that should exist and does not.

This page is about the report. If you open a post or page that is published in your dashboard and it answers 404, that is a fault on the site, and how to fix 404 errors on posts and pages that exist has the fixes.

What the status says

Google's help for the Page indexing report opens its entry for this status with one sentence: "This page returned a 404 error when requested." The rest of the entry, and the page around it, say this:

  • How Google got the address. It found the address by itself, not from a sitemap or a request of yours: as a link on another page, or because a page used to be there.
  • It will ask again. Googlebot will probably keep trying the address for some time, less and less often, and there is no way to tell it to forget an address for good.
  • The list is a sample. The table under the status holds examples, at most 1,000 rows, and does not necessarily show every address.
  • The list empties by itself. The report shows only addresses that answered 404 in the past month.

The report gives "Website" as the Source of this status. That means your server gave the answer. It does not mean the answer is wrong.

Google's separate help page on 404 errors says that in general they do not affect a site's search performance, and that many are not worth fixing because 404s do not harm indexing or ranking. The Page indexing help gives the rule for the rest: fix only the 404s that you link to yourself or list in a sitemap.

The report shows the last crawl, not the site today. On our own site, the first ten examples under this status had been crawled before the pages at those addresses were published. Asked for again on the day the report was read, four answered with a page and five with a single redirect to the page that replaced them. The tenth was an address under /wp-content/, which the site does not have. So ask an address yourself before you decide anything about it.

Sort the list into four kinds

KindFor exampleWhat it needs
Never was a pageA mistyped link, a link cut short, an address pieced together from a scriptNothing
Removed on purpose, with no replacementAn old event, a retired post, a discontinued productNothing. A 404 is right, and a 410 says the same
Moved or renamedAn edited slug, a new permalink structure, a rebuilt siteA 301 redirect to the new address
Should existA page deleted or unpublished by mistakeThe page back

Never was a page. Google's help on 404 errors says these come from mistyped links and from Googlebot trying addresses it finds in scripts or other embedded content, and that they have no effect on crawling or ranking. The exception it names is a common misspelling, which can be worth a redirect.

Removed on purpose. Google's documentation on crawl errors says a page you removed, with no replacement of similar content, should answer 404 or 410. For a product that will not return, see out-of-stock and discontinued products.

Moved or renamed. These cost visitors, and they come in numbers after a rebuild. Traffic dropped after a redesign works through them, the redesign SEO checklist is for before a launch, and changing permalinks safely covers a change of the whole structure.

Should exist. Look for the page under Posts or Pages, among the drafts and in the Trash, then restore it and publish it again. If it is published and still answers 404, use the 404 error page.

Start with the addresses that used to bring visitors.

Ask what an address answers today

This asks for one address and prints its status line and the headers that matter here. Put the address from the report in place of the one shown.

bash
curl -s -o /dev/null -D - https://example.com/spring-menu/ | grep -i -E "^(HTTP|expires|cache-control|x-redirect-by|location|x-robots-tag)"

A WordPress site with nothing at that address answers like this. A live site may print the first line as HTTP/2 404.

text
HTTP/1.1 404 Not Found
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private

The first line is the status. The other two are headers WordPress sends with every 404 it answers, and they tell browsers and caches not to keep the answer. There is no X-Robots-Tag line. The page itself, your theme's "Page not found", carries the same robots tag as any other page, max-image-preview:large, with no noindex, and needs none: Google's documentation on status codes says it does not use the content of an address that answers 4xx, and that an indexed address which starts answering 4xx is removed from the index.

The first line saysAndRead it as
404Nothing is there. Right for the first two kinds
410A rule on the server says the page is gone for good
301a line X-Redirect-By: WordPressWordPress, or a plugin running in it, forwarded the address. Check that Location is the right page
301no such lineA rule outside WordPress forwarded it, such as one in .htaccess
200A page is served now, and the report is behind

To check a whole list, the loop in traffic dropped after a redesign asks every address in a file. The redirect checker follows one address through every hop without a terminal.

WordPress's guess: a missing address that does not answer 404

Before WordPress gives up on an address, it looks for published content whose slug begins with the name in the address, and redirects there with a 301. These are answers from a WordPress site on "Post name" permalinks.

Asked forThe site hasAnswer
/opening-hours/, which never was a pageA post at /opening-hours-over-the-holidays/301 to that post
The same address, before that post was publishedNothing like it404
/spring-menu/, a page now in the TrashA post at /spring-menu-tasting-night/301 to that post
/catering-prices/, which never was a pageA page at /catering/404

The guess rescues a link that was cut short. It also means a removed page may never answer 404: its address is sent to whatever shares the start of its name, and visitors land on a page about something else. Such an address is not in this list. It is under Page with redirect. And because the answer depends on what is published that day, an address can move between the two lists without anyone touching it.

When more than one slug fits, WordPress takes the first the database returns. Its query asks for no order.

What not to do

Do not redirect every 404 to the home page. Google's help on 404 errors counts a redirect to the home page, in place of a 404, among soft 404s. Its guide to moving a site says not to send many old addresses to one irrelevant destination, which might be treated as a soft 404. The guide's exception is real consolidation: several old pages merged into one can all redirect to it.

Do not block the addresses in robots.txt. The same help page says invalid addresses should return a proper 404 and should not be blocked by robots.txt. A blocked address cannot give Google its 404. See Blocked by robots.txt.

Do not answer 200 with a "not found" message. That is a different status in the same report, "Soft 404". Google's help describes it as a page that shows a "not found" message without sending a 404 code, and its documentation says such pages are excluded from Search. WordPress's own "Page not found" page is sent with a 404, as shown above, and a custom design for it is fine as long as the status stays 404. Anything that shows the home page or a search page at a missing address, with a 200, is what that definition describes.

Do not file removal requests to clear the list. Google's help says a removal request does not take an address out of this report.

If the list is longer than you can sort by hand, WP Ministry's WordPress SEO audit is a one-time, written audit of what stands between a WordPress or WooCommerce site and a search engine.

What causes it

How to fix it

Redirect an address whose page moved

  • Takes care
  • Back up first
  • About 10 minutes
  • Steps tested on WordPress 7.1.3

Google's help for this status says a page that has moved should answer with a 301 redirect to its new location.

  1. Step 1: Ask what the old address answers

    Run the command under "Ask what an address answers today". WordPress may already forward it. When the slug of a published post changes, WordPress saves the old slug with the post and answers the old address like this:

    If Location is the page's new address, there is nothing to add. WordPress does not do this for pages: a page whose slug changed answers 404 at its old address.

    text
    HTTP/1.1 301 Moved Permanently
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
    X-Redirect-By: WordPress
    Location: https://example.com/holiday-hours/
  2. Step 2: Add a redirect where the answer is 404

    On Apache, put one line for each old address at the top of .htaccess, above # BEGIN WordPress. Download a copy of the file first: a line the server cannot read stops every page.

    How to set up redirects in WordPress has the other places a redirect can live: a plugin's list, nginx and code. For many addresses at once, the redirect map builder turns a list of old and new addresses into rules.

    .htaccess
    Redirect 301 "/our-team/" "/people/"
  3. Step 3: Ask again

    The old address should answer 301 with the new address in Location, and the new address should answer 200.

A saved slug lasts only as long as its post. With the renamed post in the Trash, its old address still answers 301, to an address of the form /?p=123, and that address answers 404. With the post deleted for good, the old address answers 404 itself. A site rebuilt on a fresh install starts with no saved slugs at all.

To undo it: Remove the line from .htaccess.

Answer 410 for an address that is gone for good

  • Takes care
  • Back up first
  • About 5 minutes
  • Steps tested on WordPress 7.1.3

A 404 is enough for a removed page, and Google's help says it currently treats a 410 the same as a 404. Use a 410 where WordPress's guess sends a removed address to an unrelated page, or to say that the removal was deliberate.

  1. Step 1: Add a rule above WordPress's block

    On Apache, the lines go at the top of .htaccess, above # BEGIN WordPress. Download a copy of the file first.

    .htaccess
    RedirectMatch gone "^/spring-menu/?$"
    RedirectMatch gone "^/events/2019/"
  2. Step 2: Ask for the address

    Run the command under "Ask what an address answers today". Its first line should now say 410 Gone.

The server answers before WordPress starts, so the visitor sees Apache's own short "Gone" page, not your theme's "Page not found". No other address is touched.

To undo it: Remove the lines from .htaccess.

Stop WordPress redirecting missing addresses by guesswork

  • Takes care
  • Low risk
  • About 10 minutes
  • Steps tested on WordPress 7.1.3

Do this on a site where the guess keeps sending removed addresses to the wrong pages: one with many similar slugs, such as a store's products, or one that removes pages often. WordPress has had a filter for each of the two changes below since version 5.5.

  1. Step 1: Open wp-content/mu-plugins

    Create the folder if it is not there. WordPress loads every PHP file that sits directly in it, and such a file is switched off only by removing it.

  2. Step 2: To keep exact matches only, create exact-404-guess.php

    With this, WordPress redirects only when a slug matches the name in the address exactly.

    wp-content/mu-plugins/exact-404-guess.php
    <?php
    // Redirect a missing address only to content whose slug is exactly the name asked for.
    add_filter( 'strict_redirect_guess_404_permalink', '__return_true' );
  3. Step 3: Or, to switch the guess off, create no-404-guess.php

    Use one file or the other, not both.

    wp-content/mu-plugins/no-404-guess.php
    <?php
    // Do not guess a redirect for an address that finds nothing.
    add_filter( 'do_redirect_guess_404_permalink', '__return_false' );
  4. Step 4: Ask for a removed address again

    It should now answer 404.

What each choice leaves in place, on the same site as the table above:

Asked forWordPress as it comesExact matches onlyGuess off
/opening-hours/, a cut-off link to a post301 to the post404404
/spring-menu/, a removed page301 to a post with a similar slug404404
/private-dining/, a page since moved under /catering/301 to its new address301 to its new address404
The old slug of a renamed post301 to the post301 to the post301 to the post

Neither file touches a saved slug or the redirect that adds a final slash. With the guess off, a page you move under another parent needs a redirect from you.

To undo it: Delete the file from wp-content/mu-plugins.

Let the report catch up, or use Validate fix

  • Easy
  • No risk

Nothing has to be pressed. Google's help says it updates the count whenever it crawls an address with a known issue, whether or not validation was requested. An address that keeps answering 404 leaves the list too: the help on 404 errors says they should drop out of the report after about a month.

"Validate fix", on the status's own page in the report, is a request and not a switch. As the help describes it, it is for when every instance of the issue has been fixed. Search Console checks a few of the addresses at once, and stops there if one still has the issue. Otherwise it works through the known addresses under the status, and only those, and ends as failed at the first one where the issue is still present. The help says validation typically takes up to about two weeks and sometimes much longer.

For this status that has a plain consequence. A list that rightly keeps some addresses answering 404 cannot pass, and a failed validation changes nothing about the site. Validate only when every address under the status was one you fixed.

When to get help

Get help when the list holds pages that used to bring visitors, or when it grows after a redesign or a migration. Both mean addresses with a history are answering 404, and each needs matching to the page that replaced it. On a site rebuilt on a fresh install, WordPress kept no record of the old addresses, so the map has to be made from a backup, an old sitemap or Search Console's own exports.

Common questions

Do 404 errors hurt my site's rankings?

Google's help on 404 errors says that in general they do not affect a site's search performance. What can cost visitors is a page that people were finding and that now answers 404 with no redirect to its replacement.

How long do the addresses stay in the report?

The report shows only addresses that answered 404 in the past month, and Google's help says a 404 should drop out after about a month. Google gives no date for when it stops asking for an address, only that it asks less and less often and cannot be told to forget one.

Should I use 410 instead of 404?

Either is right for a page that is gone with no replacement. Google's help says it currently treats the two the same. A 410 has a second use on WordPress: a rule on the server answers before WordPress can redirect the address by guesswork.

More on this subject

Would you rather we fixed it?

SEO audit is $249. A written audit, each finding with its source, and up to 2 hours of fixes done and tested again. It starts with a free diagnosis.