WordPress

How to fix WordPress posts returning 404 error (Quick Fix)

WordPress is undoubtedly easy to use but sometimes it triggered errors that can make someone panic. Every WordPress user came across an issue of WordPress posts returning 404 error one another day. At first glance, seeing 404 screen on a live website seems like a nightmare, but don’t worry! Your all posts are safe and here at tnandla, we come up with a complete fix.

Reason of error:

WordPress posts returning 404 glitch appears when something wrong with htaccess file. It might get corrupt, deleted or any plugin implemented the rewrite rule that does not fits well with the database environment. As the root cause if htaccess file, so recreating it or adding a new rule to it will fix the problem and your pages and posts will be live again.

1) Fixing the WordPress posts returning 404:

It is very basic fix yet it works pretty well. Just go to settings, then permalink and click save. This process will trigger WordPress to recreate a htaccess file and flushes the previous rewrite rules. In most of the cases this fix solves the issue and it is enough; otherwise, we need to update file manually. See the screenshot below:

Post returning 404 error Fix

1/2

Post returning 404 error Fix 2

2/2

2) Fix via Editing htaccess file:

Here is the ultimate fix for WordPress posts returning 404 error. It is a little bit technical but following the guidelines will make it a piece of cake for the WordPress user.

Login to your hosting, go to Cpanel or any other core hosting interface that you are using. Now go to file manager and find htaccess file. In case you cannot find it, just change the settings to show hidden files. You might need to change the permissions to make it writable. Once you find it, just download it.

Open the downloaded htaccess file with any text editor and manually add the code in file. Save it and upload it back. Here is code 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

Easy way:

There is also another easy way of editing htaccess file. If you are yoast user, then in yoast setting > file editor. Here you will see the htaccess file. Simply edit a file via yoast and add the code that we have shown above.

We hope your error of WordPress posts returning 404 is fixed by implementing our guidelines. If this article helped you, please tell us in comments below so we make it more detailed and helpful for the readers!

Leave a Comment