Learn How to Fix WordPress Post 404 Error

learn how to fix wordpress post 404 error

WordPress is the best CMS platform till now we can create websites instantly without code. Yeah, we understand you don’t want to be here to learn what is WordPress you need to fix WordPress 404 post error. Don’t worry we are here help you.

In this troubleshooting tutorial we are going explain various steps to resolve WordPress 404 post error. First you don’t panic about this error because your data and content is completely safe. Let’s begin.

When you are facing WordPress 404 post error you are not able to access single post but you are able to access blogs or website main page and WordPress admin dashboard. Follow the steps below.

  • Login to WordPress admin
  • Click Settings>Permalinks
  • Click Save Changes

After that go and check your single post link, most of the time this step will resolve the WordPress 404 post error. If still facing the same issue will move the next step.

.htaccess

Login to your server via ftp, if you don’t have ftp credentials create one or ask your hosting provider. Go and find the .htaccess file on your WordPress root path then open the .htaccess file and copy and the paste the below codes on your .htaccess file.

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

Plugin:

Maybe this error causing because of Plugins so go to Plugins and deactivate the recently installed Plugins and check the post URL, if you’re still getting WordPress 404 post error try with another Plugin one by one and check.

Apache:

For Apache servers we need to edit the apache.conf file. To edit the apache.conf run the commands below on your ssh terminal.

sudo nano /etc/apache2/apache2.conf

After opening apache2.conf file find the line <html> then change AllowOverride None to AllowOverride All like below.

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
sudo service apache2 restart

Enable Rewrite Module on Apache:

To enable the mod_rewrite on Apache run the code.

sudo a2enmod rewrite

After enabling mod_rewrite restart the Apache.

sudo service apache2 restart

Nginx:

To resolve the WordPress 404 post error on nginx add the below line under the loctation / { on the nginx.conf.

try_files $uri $uri/ /index.php?$args;

Like this

location / {
    try_files $uri $uri/ /index.php?$args;
    index  index.html index.htm index.php;
}

After that restart the Nginx.

sudo systemctl reload nginx

Conclusion:

That’s all these are the resolvable methods to fix WordPress 404 post error. In this troubleshooting tutorial we have learned how to fix WordPress 404 post error. Hope this article helps.

Next Article: How to Clear WordPress Website Cache

Leave a Reply

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

You May Also Like