Virginia katchoua99@gmail.com

How to Fix WordPress Pages/Posts Returning 404 Error

404 error is an HTTP status code that means the page you were trying to reach on a website couldn’t be found on that server. To be clear, the 404 error indicates that while the server itself is reachable, the specific page showing the error is not reachable or doesn’t exist.

There are often so many reasons for this which sometimes is very difficult to tell immediately but we will look into few of them which are common and have worked in the past to resolve this issue.

  1. Saving Permalinks in Settings on your Dashboard

    If you can access your WordPress Dashboard, you can do this: Go to Settings » Permalinks, and simply click on Save Changes button.



    Doing this will update your permalinks settings and resetting your rewrite rules. However, if this doesn’t solve your problem, proceed to try the next step below.
  2. Updating your .htaccess File

    Sometimes, the 404 error is usually as a result of a corrupt .htaccess file.
    To access this file, you can login to your host either using an ftp client such as FileZilla or you can access it through your cpanel dashboard » File Manager depending on your host or you can login to your server using ssh on the terminal and listing all the files in the root directory of your WordPress install using the command: $ ls -la and this will show you the .htaccess file since it’s a hidden file.
    On your FileZilla, open up the .htaccess file and modify it with the following codes replace the previous one with this:

# 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>
# ENDWordPress

Save this file and close. Refresh the site again and see if this works for you.
If no luck still, proceed to the 3rd solution below.

3.  Disabling Mod_Security in the CPanel

If the previous 2 solutions didn’t work for you, you may want to try this last one on your cpanel if you have access to it. Simply go in and disable Mod_Security and refresh your website to see if this helps out.

Hope one of these helped you resolve your 404 error on your website. Do well to leave a comment below, positive criticism is welcome, no one knows it all.

Thank you! 

 

Leave a Reply

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