WordPress posts returning 404 Error

Mostly in this situation you can access the WordPress admin area, the blog’s main page, but when opening a single post, your WordPress posts returning 404 Error. First it must be ascertained that the 404 error is being caused by the web server or by WordPress.

Check static file

Open your static file(e.g. a jpg image) like:
http://mydomain.com/wp-content/uploads/picture.jpg

If it is does not exist in media uploads directory, you have found the source of your 404 Error. If it is exit and then producing a 404 error page. It usually happens if your WordPress .htaccess file got deleted or something went wrong with the rewrite rules. You need to fix your permalinks settings by doing the following:

Login to WP-ADMIN then go to Settings> Permalinks and click on the Save Changes button.

How to update .htaccess file

It will update your WordPress permalinks settings and flush the rewrite rules. If the problem is not fixed, then you need to update your .htaccess file manually. Login into your server using FTP, and modify the .htaccess file which is located in the same location where your WordPress folders like /wp-content/ and /wp-includes/ are located. You can add the code in your .htaccess file that is mentioned below.

# BEGIN WordPress

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

# END WordPress

This is the easiest method that you can add the code to make the file writable by changing the permissions to 666.

Read our article on .htaccess file help to optimize your website for improve ranking.

In this article you learn how to fix wordpress 404 error on all pages. You can also read our similar post How to Fix the 502 Bad Gateway Error in WordPress? & How to Fix the 504 Gateway Timeout Error in WordPress?.

If you liked our articles, please subscribe to our YouTube Channel for WordPress Video Tutorials. You can also find us on social media platform like Twitter and Facebook.

4 thoughts on “WordPress posts returning 404 Error”

Leave a Comment