How to Fix WordPress Posts Returning 404 Error

Fix WordPress Posts Returning 404 Error

Even though WordPress is the most popular and powerful CMS at present but one needs to be extremely careful while editing and making changes.

A slight mistake can ruin the entire site and make it inaccessible for the users which will eventually take down the reputation of the website.

Since it is most popular and widely used, you will find the solution of every problem you face on the internet such as WordPress related blogs and forums.

There are certain common errors that WordPress website owners face more often. Some of those common mistakes are database connection error, internal server error and of course, WordPress posts returning 404 error.

A 404 error occurs when the requested URL is not found on the web server. In this article, we will talk about how to fix WordPress posts returning 404 error.

The only good thing about posts returning 404 error is that the main blog will be accessible to the users, but only when a certain post is inaccessible, users get that 404 error.

If a user is landing directly on that article from search engine result, it is definitely going to be the worst experience for him and be assured that search engine will stop listing that post and your website’s overall SEO will get affected.

fix WordPress posts returning 404 error

The primary reason for 404 error is the accidental deletion of .htaccess file, or there is something wrong with rewrite rules. There are various ways to fix WordPress posts returning 404 error depending on the cause of the error.

Steps To Fix WordPress Posts Returning 404 Error

Most people have this wrong opinion that if a 404 error occurs, the only thing to do is redirect. Redirection is a temporary solution, but you always have to find the root cause of the error and solve it.

Having too many 404 errors on your website will kill your search engine ranking due to bad user experience.

Step 1. One of the basic solutions to returning 404 error is fixing the permalinks. All you have to do is go to Dashboard and from the left menu, choose Permalinks from Settings.

Without making any changes, just click on Save Changes button. It will update the permalinks settings and refresh the rewrite rules which could be the culprit behind the problem.

fixwpposts404

Step 2. If this does not fix the problem, you have to look for .htacess file. So, you have to connect to your web server via FTP and locate the .htaccess file in the root folder.

You have to make the file writeable by making the permissions to 666. Add the following code to the .htaccess file and then change the permission of the file to 660 positively else your website can get hacked.

fixwpposts404-2

# BEGIN WordPress


RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress

Step 3. If that does not solve the problem, you have to look elsewhere. It is a common practice among web developers is to develop a new site on the local server before transferring it to the web server.

But often the permalinks used in the local server looks awful, and they can change it and make it look close to that of a web server by changing the rewrite_module in the Apache configuration of the tool they are using like WAMO, or MAMP. This process is called enabling custom permalinks in WordPress local server.

How To Enable Custom Permalink sin WordPress Local Server?

One of the easy ways to fix WordPress posts retuning 404 error is to prevent it in the first place. To do so, click on the WAMP icon in the icon tray of the taskbar and navigate to Apache and then Apache Modules.

From the drop down list, enable rewrie_module. After that, your custom permalink structure will work flawlessly else it would show page not found.

About Sonnal S Sinha

Sonnal S SinhaSonnal S Sinha is a passionate writer as well as WordPress and WooCommerce rockstar who loves to share insights on various topics through his engaging blog posts. He runs a successful website design and digital marketing company. With 15+ years of experience in WordPress theme development, he strives to inform and inspire readers with his thought-provoking content. He helps thousands of small and medium businesses and startups create a unique online presence. Follow Sonnal S Sinha for your regular dose of knowledge and inspiration.