Tutorials for web designers and developers
Tutorials for Developers_
Search
Close this search box.

How to fix Posts Returning 404 Error in WordPress?

Shabnam Rafique Bajwa

Shabnam Rafique Bajwa

Shabnam Rafique Bajwa is working as a Content writer at HFarazm. Her educational background is in Software Engineering from the University of Lahore and Masters in Software Engineering from Superior University.
404 post error

WordPress is one of the most powerful CMS. But due to some slight mistakes, it is might possible that you may not access your website. As a WordPress user, you need to be ready to handle different errors and technical glitches with time. The Posts Returning 404 Error in WordPress is such a technical issue, and one of the most common error. It is caused whenever your webserver unable to find the requested URL. In this article, we are going to show you how to fix WordPress Posts Returning 404 Error. Let’s have a look, how this error looks like in WordPress(Screenshot below)

post 404 error wordpress-

How to Fix WordPress Posts Returning 404 Error?

Before moving on let’s have a look at the root cause of this post returning 404 errors in WordPress. There are two main reasons for this error which are as below:

  1. Permalinks
  2. Rewrite .htaccess Code Via FTP.

We are going to discuss them in detail so you can understand easily how to fix this post returning 404 error in WordPress.

1. Permalinks

Mostly in this situation, users can access their WordPress admin, but they can not access their single posts and pages, there they get 404 not found error. In this situation, you need to fix your permalinks settings. Go to your Settings->Permalink and click on save changes

permalinks settings

This step will update your permalinks settings. In some cases by updating the permalink settings fixes this problem of WordPress post 404 error. However, if this doesn’t work for you then proceed to next solution.

2. Rewrite .htaccess Code Via FTP

Firstly if you want to modify your .htaccess file, login to your server using FTP and open your .htaccess file which is located in the same location where other folders like /wp-content/ and /wp-includes/ are located. The best thing you can do is to make the file writeable for a temporary period of time. You can do this by right-clicking on the file and changing its permissions to 666. In case, if file is hidden, you can contact your hosting to enable the hidden files.

After opening .htaccess file you can replace existing code with the following (always create a backup before making changes):

# BEGIN WordPress

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

# END WordPress

3. Enable rewrite Module

Mostly designers and developers install WordPress on their computers using a local server for a testing purpose. If you want to use permalinks, then enable the rewrite_module in Apache configurations like XXAMP or WAMP

Try all the above solution to resolve the issue of post returning 404 error in WordPress. I hope this article helped you in fixing post returning 404 errors. if you have any queries ask me in the comment below.

Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *