7 Ways to Fix the ‘404 not found error’ in WordPress

WordPress is one of the most powerful and easiest to use platforms for content management. You can use it to create a wide range of websites. At times it is possible to come across the 404 not found error that can appear on all the web pages or on all the pages but not the homepage. Many site owners think that the error message means that one of their posts or pages has been deleted. However, that is not the case. There are a wide range of reasons for this error.

This guide helps you fix the different types of issues that may be causing this error.

1. 404 Not Found Error on All Pages but Homepage

If you are getting the 404 error on all the WordPress pages but not the home page, you should fix the problem using the following steps:

  • Log into the dashboard
  • Click on ‘settings’ and then on ‘permalinks’
  • Click on ‘select the default setting’
  • Click on ‘save’
  • Now revert the settings back to previous form
  • Click on ‘save settings’

2. Rectify the Permalinks Structure

If this doesn’t fix the 404 not found error in WP, you should follow these steps to correct the permalinks of your site:

  • Log into your dashboard
  • Click on ‘settings’ and ‘permalinks’
  • Click on ‘select default settings’
  • Click ‘save settings’
  • Then revert the settings back to the earlier configuration
  • Click ‘save settings’

3. Resetting Rewrite Rules of .htaccess

One way to fix the 404 not found error in WordPress is to reset the rewrite rules of the file .htaccess. But this will require that you access your WP site using an FTP server.

Follow these steps to set up an FTP client:

  • Download the FTP client (select a client with a version that is compatible with your system’s OS)
  • Open the FTP client
  • Click on ‘file’ from menu
  • Click on ‘site manager’
  • Enter your website’s name
  • Enter your domain name in the ‘host’ section
  • Leave the ‘port’ section blank
  • Select FTP for ‘protocol’
  • Select plain FTP for ‘encryption’
  • Select normal as the ‘logon type’
  • Then enter your control panel’s username and password
  • click on ‘connect’ for connecting the FTP

Follow these steps to reset the rewrite rules:

  • Open your WP site’s root directory within the FTP client
  • Click on ‘server’
  • Select the option ‘force showing hidden files’ (this is important for showing all the hidden files because the .htaccess file may also be hidden by default.
  • Right click on the .htaccess file
  • Click on ‘file permissions’

Now you should make the .htaccess file writable. This can be done by using the following steps:

 

  • Enter the value 666
  • Click on ‘save’
  • Click on ‘refresh’
  • Go to WordPress and open ‘permalink settings’
  • Click on ‘save changes’
  • Go back to the FTP client and make changes to the .htaccess’ file permissions to 644
  • Refresh the client

4. Fixing the Error on Local Server

When you use a local server based on XXAMP, WAMP or MAMP, and face the ‘404 not found error’ in WordPress, the problem may be fixed by enabling the rewrite_module. If you are going to use ‘pretty’ permalinks, this is going to be essential.

  • Open server application
  • Open ‘menu’
  • Open ‘Apache’
  • Open ‘Apache Modules’
  • Check the option against ‘rewrite_module’

Edit Code on Local Server

Sometimes, it is possible that you are unable to enable the custom permalinks on your local server. In that case, you should follow these steps:

  • Open the server folder
  • Locate the ‘Apache’ folder
  • Open ‘Conf’ folder
  • Open httpd.conf file
  • Find this code: #LoadModule rewrite_module modules/mod_rewrite.so
  • Delete the pound # sign from this code
  • Save the file

Check your WordPress live site for the error.

5. Fix Plugin Error

Sometimes the 404 not found error is caused by a plugin error. This usually happens very rarely, but plugins can work incorrectly in WordPress. If there is a plugin that is wrecking havoc with a part of your website, you should disable it.

  • Open the admin panel
  • Open ‘plugins’ area
  • Click on deactivate
  • If you don’t know which plugin is causing the error, deactivate all the plugins

If the 404 error no longer appears, this means that one of the plugins is the culprit. Activate one plugin at a time and test your WP site every time to check which one was causing the error. Once you identify the plugin causing the error check its settings to ensure that its configuration is correct. If you are unable to determine why it is causing the issue, delete it and install another plugin in its place.

6. Malware Issue

If you are unable to fix the 404 not found error in WordPress using the above-mentioned methods, it is likely that it is caused by a malware. This happens very rarely. A good strategy to prevent malware attacks is to ensure that you are installing themes and plugins from trusted sources. It is also important to keep your WP site, plugins and themes up-to-date. If you are unable to determine the security issue, you should contact your web host to help and fix the issue.

7. Reinstall WordPress

After you have tried everything mentioned above, you find that the error cannot be fixed, you should consider reinstalling WordPress. The 000Webhost blog post explains the process in a simple way, allowing anyone to install WordPress without going through complicated steps. The guide covers multiple methods for installing WP so that you can choose the one that’s easier for you.

Conclusion

The 404 not found error may sound to be a simple error to many WordPress site owners because many believe it has been caused by a post deletion. However, that is never the case. There are many reasons why the error can occur and in most cases you can fix it yourself. Follow the above-mentioned steps to identify and fix the underlying cause.