How to Fix WordPress Posts Returning 404 Error

WordPress is a very strong content management system, which is also known as a CMS. Simple alterations can sometimes lead to a website being unreachable without any access. The problem which we have decided to tackle today is WordPress returning a 404 error. It is a very common error, and can be fixed easily, so let’s waste no time and get right into it.

When the 404 Not found error, starts displaying on your screen, the admin area can still be accessed by the user, but when you decide to open up a post, that area is restricted, and out of the users reach. This doesn’t mean that your posts have disappeared, so take a deep breath, relax, and start to troubleshoot it. The reason behind this could be the deletion of .htaccess file, or rewrite rules must’ve been functioning improperly. The solution to this problem is quite simple; all you need to do is go to Settings » Permalinks and press the Save Changes button.

How to Fix WordPress Posts Returning 404 Error

This will update your permalinks settings and refresh rewrite rules. For the majority of users, this solution has been successful but if you are still facing this problem then you must manually update the .htaccess file. Follow these simple steps to begin the update:

1. Use FTP to login to the server
2. Go to /wp-content/ and /wp-includes/ location
3. Alter the .htaccess file
4. Make the file writeable by altering the permissions to 666 temporarily
5. Apply the original solution again
6. Change the permissions back to 660.

If you want to manually update the .htaccess file, then write this code inside it.

# BEGIN WordPress

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

# END WordPress

Fix for Local Servers

Occasionally for testing purposes, sometimes the developers and designers, make use of a local server to install WordPress. Open the Apache configuration of XXAMP, MAMO or WAMP, whatever you use, and enable rewrite_module, if you want to incorporate pretty permalinks in your code.

We hope that our solutions guided you in resolving this error, let us know in the comments if you were successful, or if you managed to solve the problem using another technique share that with us too.


Software Engineer | Ethical Hacker & Cybersecurity...

Md Obydullah is a software engineer and full stack developer specialist at Laravel, Django, Vue.js, Node.js, Android, Linux Server, and Ethichal Hacking.