Are you experiencing a 404 error on your WordPress site?
404 page not found errors are usually caused by moving content to a new URL or removing content from a website. This typically happens if the internal links are not fixed accordingly.
If you are reading this, there’s every possibility that you are facing this issue.
Fortunately, just like every WordPress error, you will encounter it on your website. 404s are relatively easy to find and fix.
In this article, You will get to know all you need to know about the 404 page not found error on WordPress and the steps to fixing it.
What Is a 404 Error?
A 404 error is an error that signifies that you cannot access the page you are trying to navigate to.
Typically, this occurs after the page is removed or moved to a new URL on the site and the old link is not adjusted accordingly.
Why Do You Receive a 404 Page Not Found Response on Your WordPress Webpage?
This 404 error happens when your browser instructs your website to display a particular page that has been moved, deleted or has a broken link
The website will display an error message if it cannot find the page to show.
The feedback you will get because of this on your webpage is as shown below.
Causes of 404 Error in a WordPress Website
404 errors occur in a WordPress website because some pages have been removed or moved. Also, if the pages have not been redirected to a live page, it tends to cause the website to give a 404 page not found error.
Other causes of 404 errors on WordPress include:
- Changing the URL’s permalink structure of a particular page; and not redirecting it to the new URL
- Plugins or themes that are poorly coded
- Opening an incorrect URL can also cause a 404 error.
- Migrating your website to a new host can lead to a 404 error.
How to Fix 404 Error on WordPress
404 errors can be fixed in the same way as any other WordPress error. It does, however, require a certain level of technical ability.
If properly troubleshot, it can be fixed with ease.
Below are some steps you can take to fix the 404 page not found error in your WordPress-powered Site.
Refresh the Webpage
If a webpage does not load correctly, it could lead to a 404 error on a website. Fixing this is relatively easy.
All you need to do is to reload or refresh the page and the page will load correctly.
To do this, you need to click on the refresh button on the error page or click on the circular arrow sign in the top left corner of the error page.
Another way to refresh a page is by using a shortcut key. Pressing the F5 key from your keyboard automatically refreshes the page.
It is the same for both WordPress and non-WordPress websites.
Clear the Cache and Cookies of Your Browser.
Clearing your browser’s cache data is another way to fix 404 errors on WordPress, just as it is for any other non-WordPress site.
Assuming that refreshing the page did not fix the issue, the next thing to do is to access your site using incognito mode or simply clear your browser’s cache and cookies data.
To do this, you need to follow the steps below;
NOTE: I am using Chrome at the time of this article.
Click on the Chrome menu. It is located at the top right side of your browser toolbar.
Click on more tools and then click also on clear browsing history.
From the new window that appears, choose the cached images and file.
NOTE: if you don’t want to clear the whole history of the cached file, you can select a time range.
If you wish to clear cookies too, all you need to do is to check the cookies’ checkbox as well.
Once you are satisfied with your choice, click the clear data button to validate your choice.
After clearing your browser’s cache and cookies, reload the page to see if the error has been resolved.
Reset Your Permalinks
If other pages aside from the homepage of your WordPress site are showing a 404 page not found error. The next thing you would want to do is to reset your permalinks.
Resetting your permalinks will help to solve the 404 errors affecting your pages.
However, to reset and update your permalink settings you will take the following steps:
Log into your dashboard
From the dashboard, go to settings and then navigate to permalinks.
From the permalinks settings select the default setting and then click on the save changes button.
Selecting the default setting restores the permalink to its default state.
All you need to do now is to reset it back to how it was before you restored it to default.
Note: if you had a custom permalink before the error, you will need to input it back into the custom structure.
Click on the save settings buttons afterwards.
Resetting your permalinks can help to fix the 404 error or the permalinks not working error affecting your WordPress site.
Disable Plugins and Themes
404 errors can be a result of a faulty, poorly coded or outdated theme or plugin. If resetting your permalinks didn’t fix the 404 error, you should consider disabling your site’s plugins or theme until you can locate the faulty plugin or theme.
Before disabling your plugins from your admin dashboard, you might want to rename your plugin folder name. To do this you will need to access your website files using FileZilla or any other FTP.
From FileZilla go to public_HTML and then navigate to wp-content. From the already open wp-content, go to plugins and rename it.
After changing your plugin folder name, reload your website from your browser and check if the error has been fixed.
NOTE: if the error wasn’t fixed, change the folder name back to how it was.
But if after changing the folder name the error was fixed. What you will do next is rename the folder back to what it was before you changed it.
From your admin dashboard, check where your plugins are installed to determine which plugin is faulty.
To do this, follow the following steps
Go to your Admin dashboard.
Scroll to plugins and then click on installed plugins.
Deactivate all your plugins and start activating them one after the other. For each one, you activate and check if your website is working. This will continue until you find the faulty plugin. When you encounter a 404 error in your site’s front end, you will know which plugin is causing the error.
If you locate the plugin causing the 404 error, what you will do is either update it or remove it.
This step can be quite time-consuming but trust me it’s worth it if it fixes this error.
Restore Your .htaccess Files.
Another step to take while trying to fix 404 errors affecting your WordPress website is to restore your .htaccess files.
.htaccess files just like every other WordPress file are hidden and to locate these files you need an FTP client.
It is always recommended to back up your site to perform such tasks since any critical error may crash your site.
The steps below will help to achieve this, so follow them carefully.
Access your server using an FTP client like FileZilla
The .htaccess file is located in the exact location as the wp-content/wp-admin/Wp-includes folder.
Right-click on the .htaccess file and scroll to view/edit
Copy the code you see there out for safekeeping. After doing this, the next thing you need to do is to replace the code you see there with the one below.
# 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 you have replaced the code, save it.
Doing this resets your site’s permalink settings to default, and so if you had any custom permalink setting or any setting different from the default setting you will need to go back to your permalink settings from your wp-admin dashboard navigate to settings and then click on permalinks and set it up again using the same steps I showed you on how to reset permalinks.
Setting up a 301 Redirect
Redirecting your URL is another way to solve the 404 error on your website.
If you change the URL of a particular page in your site and didn’t redirect it to a new URL, it can lead to a 404 page not found error in your website.
All you need to do is to redirect the old URL to a new one and the error will be fixed.
If you are new to WordPress, then to solve the issue of 404 error, this is your best bet as this plugin helps you to:
- Manage 404 page not found issues on your website.
- It does not only allow you to manage these errors. It also helps you to organize them.
- This plugin allows you to create redirects
- It also allows you to import and export redirects.
This plugin will help you to set up a 301 redirect automatically.
The steps below will help you fix this error.
Download the redirection plugin by John Godly. Go to Wp-admin dashboard navigate to plugins and then click on add new. Install and activate it.
From your dashboard, go to tools and then click on redirection
Fill in the source URL and the target URL respectively.
The source URL is the URL you want to redirect or replace whereas the target URL is the URL you want to redirect it to or the one you want your visitors to use.
Place the URLs accordingly and then click on the add redirect button.
Furthermore, clicking on the gear icon beside the close button presents you with more options.
It allows you to change the whole process like where you want your URL to be redirected to, as well as the type of redirect you want.
After doing all these settings, click on Add Redirect to confirm the changes.
You can reload the affected page and confirm if the error is fixed
Contact Your Site’s Admin for Help
One of the most effective steps to take to fix 404 errors on your WordPress site after trying the above steps is to contact your site’s administrator.
Your website admin is your host provider.
If all the steps mentioned above were unsuccessful, then the problem might be from the host’s end. You will need to contact them by logging into your server’s site.
You can find the contact information on the server site’s masthead or on any other page that has to do with contact.
Lay your complaints to them, and they should be able to assist you from their end. It is possible that the page you are looking for has been moved to a new page.
Therefore, contacting them will help them know where the error is coming from, and they would carry out a 404 error fix by doing a domain redirect.
This domain redirect will redirect users from the old webpage to the new one.
Read also: WordPress debug mode
WordPress.com vs WordPress.org
Conclusion
Going through the steps listed above will help you to fix 404 errors or permalinks, not working errors affecting your WordPress website.
If you have found other ways to fix this error besides the ones listed above. Kindly share your insights in the comment section below.