WordPress is a commonly used CMS and can be installed both on our Free and Premium hosting plans. The “404 Page not Found” is also a common error every website owner would run across. Luckily, fixing the error is a simple task and could be done by everyone. In this article, we will walk you through the process to fix the 404 error for WordPress.
What is the WordPress 404 Error?
The 404 error is one of the many HTTP status codes which you might run into on the internet. The error page would appear when you try to access a page and your browser can’t find it. The 404 error message could be different depending on the browser you are using. For example, Firefox would return a “404 Not Found” error while Chrome would return “404. That’s an error.”.
There are different things that could cause a 404 error in WordPress such as:
- Incorrectly entered URL
- Deleted post or page
- Caching problem
- DNS issue
- WordPress compatibility issue
How to Fix the 404 Error?
As long as the “404 Not Found” error is not caused by an incorrectly entered URL or cache, there are a few things that you can do to fix the error.
Reset WordPress Permalinks
WordPress permalinks are used to structure the URL of your website. WordPress provides you with several options from which you can choose from the WordPress admin panel:
You can reset the Permalinks via the WordPress dashboard or via FTP. If you have access to the WordPress dashboard simply navigate to the Settings > Permalinks page. From there change the Permalinks to Plain, which will be a temporary change and save the changes. Once you have done that you can go back and change the Permalinks to the option which you were using.
If you do not have access to the WordPress dashboard, start by connecting to your website directory via FTP or access the File Manager. Once you have accessed your website files you will have to find the .htaccess file and edit it. Very often the .htaccess file will look as shown on the screenshot below:
To fix the .htaccess file you need to add the following default code for the .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Once you have added the code make sure to save the changes.
You can now reload your page and check if your WordPress is returning the “404 Not Found” error. If you see the page successfully – congratulations, you have fixed the error all by yourself.
How to Check if the “404 Not Found” Error is Caused by a Plugin or Theme
Sometimes the plugins and themes which you use might also affect the structure of your WordPress URL. If the above methods do not resolve the 404 error, disabling your plugins and themes is the next step you can take.
There are two ways to disable your plugins depending on whether you can access your WordPress dashboard or not. We have covered this process in our article “How to uninstall a plugin in WordPress“.
The purpose of this process is to find which plugin is causing the error by disabling them one by one. You can also revert the process and disable all plugins and enable them one by one, in case multiple plugins are causing the error. Once you have identified the plugin causing the error there are a couple of this you can do:
- You can contact the developers of the plugin so they can assist you with resolving the issue
- You can remove the plugin and look for an alternative one
If you have gone through all plugins and none of them is causing the error, you will also have to check your current theme. Unlike the plugins, this process is done much faster since you have to check only one theme. All you need to do is change your WordPress theme to a different one. You can refer to our article “How to Change a Theme in WordPress” for more information. Now check if the 404 error still persists. If the error is fixed you will once again have to choose between contacting the developers of the theme for fixing the issue or replacing the theme.