How to fix 404 errors in WordPress

A 404 error means someone asked for a page that doesn't exist. A few are normal on any site. But a 404 on a page that used to rank, or one linked from your own content, loses visitors and wastes the links pointing at it. Here's how to find the ones that matter and fix them properly.

Rilea SEO teamNovember 14, 20264 min read

Key takeaways

  • 404s don't hurt your whole site's rankings, but 404s on pages that had links or traffic lose value you've earned.
  • Find them in a 404 monitor, Search Console's Pages report and a crawl of your own site.
  • Redirect a 404 only when there's a genuinely relevant replacement. Otherwise, leave it as a 404 or use a 410.
  • If every URL on your site returns 404 except the homepage, the problem is your permalinks, not individual pages.
  • Automatic redirects when a URL changes stop most new 404s before they start.

Do 404 errors hurt SEO?

Not in the way people fear. Google has said for years that 404s on pages that shouldn't exist are normal and don't count against the rest of your site. Bots try random URLs, people mistype addresses and old links point to pages you removed on purpose.

The 404s that do matter are the ones that cost you something:

  • Pages that used to rank. The rankings disappear along with the page.
  • Pages with backlinks. Links from other sites pointing to a 404 pass no value to your site.
  • Broken links on your own site. Visitors hit a dead end, and search engines waste time crawling it.
  • Pages people still visit, from bookmarks, emails, social posts or ads.

If every page returns 404

If your homepage loads but every post and page returns a 404, the problem is your permalinks, not your content. This often happens after a migration, a restore or a server change.

  1. Go to Settings, then Permalinks.
  2. Click Save Changes without changing anything. This rebuilds WordPress's rewrite rules.
  3. If that doesn't work, check your .htaccess file on Apache servers, or ask your host to check the Nginx configuration.

Find the 404s that matter

Use three sources together. Each catches something the others miss.

Your 404 monitor

A 404 monitor logs every missing URL that's requested on your site, with how often it's been hit. In Rilea SEO, it's on by default: go to Rilea SEO, then 404 Monitor. You'll see each URL, the number of hits, the site that linked to it and when it was last seen. Requests for missing images, scripts and fonts are left out, so the list stays readable.

Google Search Console

In Search Console, open the Pages report and look for Not found (404). These are URLs Google tried to crawl. Click any URL to see where Google found it.

A crawl of your own site

A crawler such as Screaming Frog follows every link on your site and lists the ones that return 404. These are the easiest to fix, because the broken link is on a page you control.

Decide what to do with each one

Work down the list starting with the most hits. For each URL, ask what the visitor was looking for.

SituationWhat to do
The page moved to a new URLAdd a 301 redirect to the new URL
A broken link on your own siteFix the link where it is
A typo in a link from another siteRedirect the misspelled URL to the right page
Deleted, with a close replacement301 redirect to the replacement
Deleted for good, no replacementLeave it as a 404, or return a 410
Bots probing for files you never hadIgnore it

Don't redirect every 404 to your homepage. Search engines treat redirects to unrelated pages as soft 404s, and visitors land somewhere that doesn't answer their question. A clear 404 page is better.

Add a redirect

In Rilea SEO, go to Rilea SEO, then Redirects:

  1. Enter the old path as the source, such as /old-guide/.
  2. Enter the new URL as the target.
  3. Choose Exact as the match type and 301 as the status code.
  4. Save. Rilea SEO removes the matching entry from the 404 log.

When a whole section has moved, a single rule can cover it. For example, a regex rule with source ^/news/(.*)$ and target /blog/$1 redirects every old news URL to the matching blog URL. Our redirects and 404 docs cover every match type and status code.

Stop new 404s from appearing

  • Turn on automatic redirects. Rilea SEO adds a 301 whenever you change the URL of a published post, page or product.
  • Add a redirect before you delete. If a page has links or traffic, redirect it to the closest relevant page before you remove it.
  • Plan migrations. When you change your site structure, map every old URL to a new one before launch. Our guide to switching SEO plugins covers how to carry redirects across.
  • Check your 404 log monthly. New 404s with lots of hits usually point to a broken link you can fix in minutes.

Make your 404 page useful

Some 404s are unavoidable, so make the page helpful. Say clearly that the page wasn't found, include a search box, and link to your most popular pages or categories. Make sure it returns a real 404 status code, not a 200, or search engines may index it.

Rilea SEO is a free SEO plugin for WordPress and a free app for Shopify, with every feature included.

Download for WordPress

Put your SEO budget somewhere else.

Install Rilea SEO, import your settings and keep every feature, for free.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top