What is a 404 WordPress Error and What Causes It
Http error 404 appears when you try to access a page but your browser can't find it. The appearance of the error notification may vary depending on the browser you are using. Firefox, for example, displays a "404 Not Found" error notification. Chrome, on the other hand, displays an error message that reads "404. That's an error.":
There are many things that cause a 404 WordPress error to appear, namely :
- Caching issues. Sometimes your browser is caching the page you're accessing even though it's already displaying a notification that it can't be found. As a result, you will still see a 404 error page even though your site can be accessed by other users through their browsers.
- WordPress compatibility issues. In some cases, issues with plugins or themes affect the way WordPress creates URLs and permalinks for websites. Therefore, if a visitor accesses a URL that no longer works, a WordPress http error 404 permalink will appear.
- A problem with the Domain Name Server (DNS) settings. It is possible that your domain has not been propagated to the DNS in use, so the error will still appear while you try to access the web page.
How to resolve 404 errors in WordPress
Sometimes the WordPress page "not found" error goes away on its own. This usually happens because of a problem with your web hosting provider. Before applying the methods to resolve this error, we recommend that you refresh your website after waiting five to ten minutes. If the error persists, then there could be a problem with your website. Here are the methods you can use to resolve this error:
Reset WordPress Permalink
One of the most common causes of 404 WordPress errors is a problem with the way WordPress creates Permalinks. As we know, WordPress offers several options for formatting post and page links. For example, you can configure the platform to use plan numeric links or create a URL from each post name:
The first thing you should do when an http error 404 message appears on a WordPress post is reset your permalinks. There are two ways to do this, via your dashboard and via FTP. If your dashboard is accessible, then follow the steps we'll explain below. However, if it's not, you can skip to the next method:
After logging into the dashboard, go to the Settings > Permalinks tab. Take note of the current structure used by your site as it will be changed temporarily. This temporary change is done to reset the WordPress permalink settings.
- Select the Plain option under Common Settings, and click Save at the bottom of the page:
The page will then reload. Select the previous Permalink type and save your changes once again. There aren't many steps involved when it comes to resetting the WordPress permalink structure.
Then open your browser as you normally would. Check the page that previously displayed the 404 error message and see if the error is still there or has disappeared. If it's gone, then this step has successfully returned your website to its normal state.
Restore File .htaccess WordPress
When the WordPress Permalink structure is changed, the changes are stored in a file called.htaccess. This file controls how WordPress interacts with the server and also how it creates URLs for your site's pages.
If the dashboard doesn't open due to an http error 404 in the WordPress post, then you'll need to manually edit the .htacces to reset Permalink. First, access your website via FTP and open the WordPress root folder. This is the directory that contains the WordPress installation and is usually stored in a folder called public_html or www, or also named after your website:
Open the folder and locate the .htaccess file inside. If you are using FileZilla, then right-click on the .htaccess file and select the View/Edit option. By selecting this option, you download a copy of the file to your computer and open it using the default text editor. Now you can change it to your heart's content.
Don't make any changes to the code inside the file if you're not sure or don't understand coding at all. Instead, use the default WordPress .htacess code that looks like this:
- # 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
No modifications have been made in the .htaccess file above. You are welcome to delete all changes made in the permalink structure. Then backup the content of the old .htaccess file and replace the content with the code snippet above.
After that, save the changes in the .htaccess file using a text editor and close it if you no longer use it. FileZilla will confirm whether you want to replace the existing .htaccess file with the newly edited copy. Answer yes, and the process is complete. You've just manually reset your WordPress Permalink without breaking anything in the process.
Reopen your site and check whether the error has been resolved or not. If it's gone, then the next step is to restore the Permalink structure to what it was, unless you like numbered URLs for each post.
To change the permalink display, go to the dashboard and select the Settings > Permalinks tab. After that, select the structure used by your website before the http error 404 appears, then save the changes made.
Disabling Your WordPress Themes and Plugins
As we explained earlier, sometimes the presence of plugins and themes can affect the Wordress URL structure. Of course, this depends on the plugin and theme settings used. If you've tried applying the first and second methods but the 404 error still appears, then the next method is to disable the theme and plugin.
The way to disable themes and plugins all depends on whether you can access the dashboard or not. If the dashboard is accessible, go to the Plugins -> All Plugins tab and follow the steps below to apply to each plugin:
Click the Deactivate option under the plugin name.
Go to your site to check if the http error 404 still exists.
If it's still there, reactivate the plugin that was disabled.
Move to the next plugin, and repeat the process.
Here, your goal is to eliminate each plugin, one by one. You could turn off all plugins at the same time, but unfortunately in some cases, only one plugin is causing the problem. There are three options available if disabling one plugin does solve the problem. First, check if there's a newer version of the plugin that needs to be updated. Second, don't activate the plugin until there is an update notification. Third, or finally, uninstall the plugin and look for an alternative.
If you've checked all your plugins but none of them are causing the error, then the most likely suspect is your theme. The process of deactivating a template is faster because you only need to check one theme. Go to the Themes tab and change the current theme to another one:
Go back to your site and check whether the error was successfully handled or not. If successful, update the theme to the latest version or activate another theme. Changing themes can be a bit of a hassle, but it's a useful step, especially if the theme is the cause of the 404 error.
If you can't open the dashboard, you can still disable themes and plugins manually via FTP. To disable both tools, access your website via FileZilla, then open the public_html/wp-content directory. In this directory, there are several folders and two of them are plugins and themes:
Go to the plugins directory first. Within the directory, there are individual folders for each plugin that has been installed on your website. Select one of the folders, right-click, and select the Rename option:
Rename the folder to something else, like akismet.disabled, to make it easier for you to identify it. By simply renaming the folder, WordPress will kill the associated plugin. Go back to your website and see if the http error 404 has been successfully removed or not. If the error still appears, change the folder name back to the first name. Repeat this process in turn for each plugin in the directory.
Now you know how to resolve 404 errors, especially those caused by plugins. However, if it's not a plugin, the next step is to go to your wp-content -> themes directory. Then, find the folder of your current theme and rename it, just like you did with the plugin:
WordPress requires an active theme and disabling it will only cause the platform's appearance to change to the default. Of course, this affects the appearance of the website, but this situation doesn't last forever.
Find a new theme if the error has been resolved. However, if you want to keep your old theme, restore the folder name back to its original name so WordPress can recognize it.
Conclusion
The 404 WordPress error may seem trivial at first glance, but it can affect other things. If visitors can't find the page they're accessing, they risk going to an alternative page on another website. That means less traffic to your website and fewer conversions. There are many ways to fix WordPress errors, including disabling themes and plugins, restoring .htaccess files, and resetting permalinks. We hope you found this article useful.
Thank you.