Skip to main content

How to fix 404 errors in WordPress

The "404 Error" is a HTTP (Hypertext Transfer Protocol) status code that indicates that the requested resource could not be found on the server. In other words, the web server was unable to locate the page, image, or file that the user requested.

This error occurs when a user tries to access a URL that doesn't exist on the server, or when the server is unable to locate the requested resource due to an incorrect URL or broken link. The 404 Error message is displayed as a web page, which typically includes a message indicating that the requested resource could not be found, along with options for the user to take further action, such as returning to the previous page or searching for the requested resource.

It's important to note that the 404 Error is a client-side error, meaning that it occurs on the user's end and not on the server. This is different from server-side errors, such as the 500 Internal Server Error, which indicate that something is wrong with the server and the server is unable to process the request.

Here is a list of some of the common names given to the "404 Error" page:

  • Page Not Found
  • Error 404
  • 404 Error Page
  • 404 File Not Found
  • File Not Found
  • The requested URL was not found on this server
  • Resource Not Found
  • Page Cannot Be Displayed
  • Oops! This Link Appears to Be Broken
  • Sorry, the Page You Requested Cannot Be Found
  • 404 Not Found
  • The Page You Are Looking For Does Not Exist
  • This Page Cannot Be Found
  • The Page You Requested Was Not Found
  • The URL You Requested Could Not Be Found

The main purpose of the 404 Error page is to inform you that the requested page could not be found. In other words, it doesn't exists, or doesn't exist anymore. The page may never have existed, been moved or deleted.

We'll take a look at 13 common causes of 404 error pages in WordPress, and provide you with step-by-step instructions on how to fix each one.

If you have set up a custom permalink structure for your WordPress site, but it's not set up correctly, it can cause 404 error pages.

To fix this issue, you can see our guide about regenerate WordPress permalinks.

2. Deleted Pages or Posts

If you delete a page or post on your WordPress site, anyone who tries to access it will see a 404 error.

To fix this issue, you can try the following:

  1. Create a new page or post with the same name as the deleted one.
  2. Use a plugin like "Redirection" to set up a redirect from the old URL to the new one.
  3. If the page or post was important, consider restoring it from a backup.

Broken links can occur when the URL of a page or resource on your site changes, and someone tries to access the old URL.

To fix this issue, you can try the following:

  1. Use a plugin like WPS Checker to scan your site for broken links.
  2. When you find a broken link, update it to the new URL, or set up a redirect from the old URL to the new one.
  3. Consider regularly checking for broken links on your site to prevent this issue from recurring.

4. Incorrect File or Folder Names

Incorrect file or folder names can result in a 404 error if someone tries to access a resource that does not exist.

To fix this issue, you can try the following:

  1. Check the names of all the files and folders on your site, and make sure they are correct.
  2. Update the names of any incorrect files or folders, and update any links that point to them.

5. Incorrect File or Folder Permissions

Incorrect file or folder permissions can cause a wide range of issues with your WordPress site, including 404 error pages.

To fix this issue, you can try the following:

  1. Log in to your server via FTP or cPanel.
  2. Find the file or folder that is causing the issue.
  3. Right-click on the directory and select "File permissions."
  4. Make sure that the directory permissions are set to 755.
  5. If the permissions are incorrect, change them to the correct values.
  6. Repeat the process for each file on your WordPress site and make sure that the file permissions are set to 644.
  7. Save your changes, and test your site to see if the issue has been resolved.

6. Misconfigured .htaccess File

The .htaccess file on your server can control many aspects of your WordPress site, including how URLs are structured. If it is misconfigured, it can result in a 404 error.

To fix this issue, you can try the following:

  1. Access the .htaccess file using an FTP client or the file manager in your hosting control panel.
  2. Download a backup of the file to your computer, in case you need to restore it.
  3. Edit the file and make any necessary changes, following the guidelines provided by your hosting provider or WordPress documentation.
  4. Save the file, and then test your site to make sure the issue has been resolved.

If the issue persists, try to replace any current code in the .htaccess file by the following code:

# 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

7. Plugin Conflicts

Sometimes, plugins can conflict with each other and result in a 404 error.

To fix this issue, you can try the following:

  1. Deactivate all plugins on your WordPress site, then reactivate them one by one until you find the one that is causing the conflict.
  2. If you find the conflicting plugin, either deactivate it permanently or find an alternative that is compatible with the rest of your plugins.
  3. If you are unable to find the conflicting plugin, consider reinstalling all plugins, or contact the plugin developers for support.

8. Theme Issues

Just like plugins, themes can also cause conflicts that result in a 404 error.

To fix this issue, you can try the following:

  1. Switch to a default WordPress theme, such as "Twenty Twenty-One."
  2. Test your site to see if the issue has been resolved.
  3. If the issue has been resolved, the problem was with your theme. You can either switch to a different theme or contact the theme developer for support.
  4. If the issue has not been resolved, the problem is with something else on your site.

9. Incorrect URL Input

If someone tries to access a URL on your site that does not exist, they will see a 404 error.

To fix this issue, you can try the following:

  1. Double-check the URL that the user entered to make sure it is correct.
  2. If the URL is incorrect, you can provide the user with the correct URL.
  3. If the URL is correct, the page may have been moved or deleted. In this case, you can either provide the user with a different page on your site, or set up a redirect from the old URL to a new one.

10. Server Issues

In some cases, server issues can result in a 404 error.

To fix this issue, you can try the following:

  1. Contact your hosting provider for support, and explain the issue you are experiencing.
  2. If the issue is with the server, your hosting provider should be able to resolve it.
  3. If the issue is not with the server, your hosting provider should be able to help you determine the cause of the problem.

11. Caching Issues

Caching can cause issues with your WordPress site, including 404 errors.

To fix this issue, you can try the following:

  1. Clear the cache on your browser, as well as any caching plugins you have installed on your site.
  2. If the issue persists, try disabling caching on your site temporarily, and then test it again.
  3. If the issue has been resolved, re-enable caching and make any necessary adjustments to your caching settings.

12. Misconfigured Redirects

If you have set up redirects on your WordPress site, but they are misconfigured, they can cause 404 error pages.

To fix this issue, you can try the following:

  1. Log in to your WordPress admin area.
  2. Go to the "Settings" section, and select "Permalinks."
  3. Check the settings for your redirects, and make sure they are set up correctly.
  4. If the redirects are incorrect, make any necessary adjustments.
  5. Save your changes, and test your site to see if the issue has been resolved.

13. Corrupted WordPress Database

In some cases, a corrupted WordPress database can cause 404 error pages. To fix this issue, you can try the following:

Log in to your server via cPanel.

  1. Go to the "Databases" section, and find the database for your WordPress site.
  2. Backup your database, in case you need to revert to the original version.
  3. Repair the database, following the instructions provided by your hosting provider.
  4. Test your site to see if the issue has been resolved.