A common problem that most WordPress users face or will probably face at some point is WordPress page not found error.
Page not found can happen as a singular 404 error when you delete an old published post or change post URL and forget to add redirection.
For example, if my link to contact page is kasareviews.com/contact but I delete that page, any link which redirects to that page will instead show your theme default 404 page.
Same will happen if I change link kasareviews.com/contact to kasareviews.com/contact-form and don’t add 301 redirect so that old links pointing to kasareviews.com/contact now redirect to correct page URL.
But in this post, I want to focus on scenario when a user can access their WordPress admin area, their blog’s main page, but when accessing a single posts or pages they get a 404 not found error.
So you know links are correct and pages and posts still exist, but for some reason, they show page not found error when visited.
This usually happens if your .htaccess file got deleted or something went wrong with the rewrite rules. What you need to do is fix your permalinks settings.
Mainly those “Page Not Found” are called dead links and are generated by some reasons. Possible reasons are:
- The page you are trying to reach does not exist
- The visitor mistyped the URL
- The permalink structure of the site has been changed
- The incoming links point to pages that were moved to different locations
Improperly coded plugins, custom post types, and taxonomy alterations can break or corrupt the permalink thus causing 404s.
Sometimes a WordPress website for seemingly no reason at all delivers the dreaded 404 “page not found” error for pages and posts that actually exist.
This error is mostly prompted when you navigate from home page to other pages of your website.
Usually, the 404 page not found error occurs if you mess with website settings or some other plugin modifies them.
1. ISSUE: A WordPress website shows “404 Not Found” errors on all the pages except home
#METHOD 1: RE-SAVE PERMALINKS
You can reset the permalink by going to the permalinks tab in wp-admin and simply re-saving the permalink structure.
Navigate to: WordPress Dashboard → Settings → Permalinks and click “Save Changes.”
If resaving permalinks doesn’t help, try changing your permalinks structure. Choose one that you don’t use and click Save Changes.
Now change your Permalinks setting back to your original configuration which was likely /%postname%/.
View your home page again and see if the Permalinks reset fixed WordPress page not found error.
This will update your permalinks settings and flush rewrite rules. In most cases, this solution fixes the WordPress the requested URL was no found on this server (404 error).
#METHOD 2: UPDATE YOUR HTACCESS FILE MANUALLY
If above method doesn’t fix your issue with WordPress 404 page not found error, then you probably need to update your .htaccess file manually.
Login to your server using FTP, or using cPanel and modify the .htaccess file which is located in the same location where folders like /wp-content/ and /static/lib/ are located.
Be noted that .htaccess is a hidden file, so you must set all files as visible to be able to edit.
You can delete .htaccess file (download it before just in case) or just rename it (revert back when done) and see if the issue still persists.
The .htaccess file will be automatically generated again if you delete it or rename so don’t worry.
You can also remove all code and manually add below code in your .htaccess file to revert it to default:
#METHOD 3: DISABLING ALL PLUGINS
More than once I was able to solve 404 not found error on my WordPress site just by disabling all plugins.
Start by deactivating plugins one by one to see if any of plugins cause the issue. Every time you deactivate plugin, just refresh your site and check if issue is gone.
If you cant access you site admin then deactivate all plugins through cPanel or using FTP by renaming plugins folder or plugin one by one.
You will find plugins folder under /static/ext. Just rename plugins folder to anything you want. Don’t forget to return it later. You can apply the same system for particular plugins.
You can also try switching your current site theme to WordPress default theme (Twenty Sixteen for example).
If you cant access your site admin just rename your theme through cPanel or FTP and it will be switched to default WordPress theme automatically.
#METHOD 4: OPTIMIZING DATABASE
If you tried above methods and still seeing 404 errors, then the next step I would recommend is a database optimization.
Now in this case of page not found error, this is a long shoot and for me it never solved issue. But still, you can try.
While database optimization can be done through cPanel using PHPMyAdmin I would recommend using plugin for anyone that doesn’t want to risk messing somehing or does not have acces to cPanel.
You can use plugin like WP-Optimize. Also, many security plugins and some cache plugins like WP Rocket have already integrated database optimization feature s you can utilize that.
If this method also didn’t help you solve WordPress page not found error, then I can only recommend that you contact your hosting support and see if they can help you.
2. ISSUE: WordPress website shows “404 Not Found” error because of broken link or incorrect inputted URL
This issue is usually isolated case and does not impact the whole site. It is probably case of broken link on your site.
The easiest way to find those dead links is using “Google Webmaster Tools”.
If you already submitted your site to Google Webmaster tools, then you can find those dead links under Crawl Errors option.
Another way you can find dead links is by using WordPress plugin called Broken Link Checker.
When you get the dead link, then just redirect the page to another page or home page. For redirection of links, I use Redirection plugin.
WordPress Page Not Found Final Words
Sometimes your WordPress website may start showing you 404 page not found errors even though the pages clearly exist.
In some cases you may be able to access your home page, but nothing else. Clicking any menu item, post title or read more link gives you a dreaded 404.
Unfortunately, this happened to me more than several times. Sometimes mentioned methods will help and solve issue but often problem can be deeper.
In that case, you will need to contact your hosting support and work together with them to try and solve issue.
I hope you found this guide helpful and that you were able to solve your “WordPress page not found” problem.
If you have any other method or solution to get rid of this problem please share in the comment section below. I am sure, it will be beneficial for others who are facing similar issue.