How To Fix WordPress 404 Not Found Error

how to fix wordpress error 404 page not found

WordPress ‘404 not found error’ indicates that a requested page or post cannot be found on your website. This error can occur unexpectedly, or in some cases, after you make changes to your WordPress site.

Thankfully, fixing this error is very easy and requires no technical experience. In this guide, we will take you through the steps for fixing posts returning 404 error in WordPress.

Content:

  1. What Does 404 Error Mean and What Causes It?
  2. How to Fix WordPress Posts Returning 404 Error
  3. How To Monitor 404 Error on Your Website
  4. Frequently Asked Questions
  5. Conclusion

What Does 404 Error Mean and What Causes It?

When a 404 error message pops up, it simply means the server can’t find the file the user requests.

For instance, If you try accessing a specific URL (say domain.com/what-is-WordPress), if no content carries that name, you’ll get a 404 error message.

This error has absolutely nothing to do with your server, it just means the requested file (image, page, or post) is missing.

The error message may differ slightly based on the browser you use.

Google Chrome reads “404. That’s an error.” “The requested URL /~ was not found on this server. That’s all we know”

google 404 error page

Other variations include:

  • “The page cannot be found”
  • “We can’t find the page you’re looking for.”
  • “The requested URL was not found on this server.”
  • “Not Found”
  • “HTTP Error 404”
  • “Error 404”
  • “404 Not Found”

Also, you can set up your own unique 404 error page using a WordPress plugin. While this isn’t crucial, it helps you explain better to your audience, letting them know what next to do.

Custom 404 error page

Note that this error is not unique to WordPress alone. It can happen on any website.

How to Fix WordPress Posts Returning 404 Error

Since this ‘404 not found error’ indicates a problem with your links, you can usually fix it by ensuring your permalinks are correctly configured and saved. You may also need to reset your linking structure using your .htaccess file.

1. Save Permalinks to Fix WordPress Error 404

Very often, the solution to 404 error in WordPress is simply saving your permalinks. Doing this will update your .htaccess file with the correct configurations for your WordPress website.

To save permalinks, login to your WordPress dashboard and go to Settings >> Permalinks.

Permalink Settings in WordPress

Next, scroll to the bottom and simply click Save Changes.

Save Permalinks in WordPress

Now try accessing your posts to see if the issue is resolved.

2. Manually Reset Permalinks

If saving the permalinks does not solve your WordPress error 404 issue, you can manually reset it by editing your .htaccess file.

To do this, access your website files using FTP. When connected via FTP, locate your .htaccess file and edit it.

edit htaccess

Add in one of the following codes, save, and upload the updated file to your server:

A) Reset permalinks when your site is in the main domain

If your site is on the main domain, e.g. www.yoursite.com, add this code to your .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>
# END WordPress

After editing and uploading the file, refresh your site and access posts and pages to see if this fixes your WordPress error 404 issue.

B) Reset permalinks if your site is in a subdomain and fix WordPress 404 Error

If your site is installed in a subdomain, such as blog.yoursite.com, use this code instead.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

C) Reset permalinks when your site is in a subdirectory

If your site is on a subdirectory, such as www.yoursite.com/blog, edit .htaccess to include this code instead.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

3. Request Professional Help

WordPress is a flexible platform – no doubt. But, its flexibility can be a double-edged sword. Sometimes, you just do too much, overtaking some settings and the whole hell breaks loose, random errors start appearing, and your site goes down.

Luckily, because WordPress has so many users, finding help is not hard. We have done a series of articles covering the most common WordPress errors, explaining to you how to fix them.

For example, we have done an article on How to fix briefly unavailable for scheduled maintenance, How to fix WP syntax error, or Maximum Execution Time Exceeded errors.

You can also check our WordPress support forums to learn how to ask for WP Help.

Of course, if you are unable to fix issues yourself, you can always contact FixRunner, and get your site back to full speed ASAP.

How to Monitor 404 Error on Your Website

We may not be able to prevent WordPress error 404 from occurring but we can monitor and minimize it using the following.

Google Search Console

You can view a list of 404 errors that google has encountered on your site. To do this, sign up for an account, verify your website. Next, go to Crawl Errors >> Not found.

Google Analytics

This tool tracks and reports 404 error. To do this, sign up with Google Analytics and start tracking.

WordPress Plugin

If you prefer a WP plugin, the Redirection plugin can help you track 404 errors from your WP dashboard.

Ahrefs (or any Third-Party Audit Tool)

Tools like Ahrefs are effective in monitoring 404 errors on your WP site.

Frequently Asked Questions

What is the WordPress Error 404 Page Not Found?

The WordPress Error 404 Page Not Found occurs when a visitor tries to access a page on your website that doesn’t exist. This can happen for a variety of reasons, including broken links, deleted pages, or incorrect permalinks.

How can I fix a 404 error on WordPress?

Here are a few things you can try to fix 404 error on WordPress:

  • Check your permalinks: Go to Settings >> Permalinks in your WordPress dashboard and make sure your permalink structure is correct.
  • Use a plugin: Install and activate a plugin like Redirection, which can help you manage and redirect broken links.
  • Check for broken links: Use a tool like Broken Link Checker to find and fix broken links on your website.
  • Restore deleted pages: If you’ve accidentally deleted a page, you can restore it from your website backup or use a plugin like WP-Optimize to recover it.

Why is it important to fix the WordPress Error 404 Page Not Found?

Fixing the 404 error on WordPress is important for several reasons:

  • It improves user experience: When visitors encounter a 404 error page, they may leave your website and never return. By fixing the error, you can ensure that visitors have a smooth and enjoyable experience on your website.
  • It improves SEO: Search engines like Google penalize websites that have too many broken links or 404 errors. By fixing the error, you can improve your website’s SEO and help it rank higher in search engine results pages.
  • It helps you track your website’s performance: If you have broken links or pages that return a 404 error, you may not be able to track your website’s performance accurately. By fixing the error, you can ensure that your website analytics are accurate and reliable.

How can I prevent 404 errors on WordPress?

To prevent 404 errors on a WordPress site, make sure to regularly check for broken links and update them as needed. You can also use a plugin to automatically redirect users to a relevant page if they encounter a 404 error. Additionally, consider setting up a custom 404 page that provides helpful information and links to other pages on your site.

What should I do if I can’t fix a 404 error on my WordPress site?

If you’re unable to fix a 404 error on your WordPress site, you may need to seek help from a professional. Consider hiring an experienced WordPress developer or contacting your web hosting provider for assistance. They may be able to help you identify and fix the underlying issue causing the error.

How Can You Use This Information?

Fixing ‘404 not found error’ usually involves ensuring your WordPress permalink structure is correctly configured in your .htaccess file.

The steps covered in this guide have shown you how to do this from within the WP dashboard, as well as by manually editing .htaccess. In some cases, the solution may be more complex. For example, you may need to enable mod_rewrite if it is disabled. If you have gone through the steps and still have WordPress error 404 issue, please tell us about it in the comments. We will provide a quick fix.

Alternatively, you can request our WP Support service and one of our developers will get to work immediately to fix your site.

For more step-by-step WordPress tutorials check our WordPress blog.

 This post was written by Mesheal Fegor

Mesheal Fegor is a Web/WordPress Developer and technical writer. His WordPress help articles have been featured on Kinsta and other sites. Mesheal holds a master's degree in computer science. His writing focuses on technical WordPress issues, ranging from core WordPress problems, to issues with WooCommerce, and more.

Last edited by: FixRunner Team