wordpress giving 404 error all posts

No doubt WordPress is the best and the easiest CMS ever build. But sometimes it acts like a little slicker, a slight tweak may fix your website and make it up and running smoothly. So, WordPress start to malfunction where we switch to a different hosting environment this may be due to your migration problem or any server issue. The first thing you have to do in this situation is not to panic. Maybe you are able to see your homepage but when you enter any content page WordPress gives you with 404 Error. We know this is extremely frustrating. So, without further gossip let’s jump in to make our hand dirty and fix this issue:

Let’s start:

  • First login to your WordPress dashboard by entering your dashboard URL, most often it is http(s)://example.tld/wp-admin if you haven’t changed your WordPress dashboard URL.
  • Now, If you are seeing “Database Update Required” message don’t worry and click on update WordPress database button.
  • Now click on continue to log in to your WordPress backend.
  • Enter your WordPress credentials and login in.
  • Now Go to Settings » Permalinks (select post if not selected) and simply click on Save Changes button.
  • This simple process might fix your problem.

But we all know WordPress is not that simple and easy all the time. If the above fix didn’t work for you then you probably need to update your .htaccess file manually. Login to your (S)FTP, we will recommend using FileZilla (If you don’t know how to login to your (S)FTP then follow this tutorial) and go to the root of your WordPress installation i.e where your wp-content, wp-include folders are located and since the .htaccess file is made hidden by default due to security purposes, you have to make it visible by following the below method:

  1. At this moment I think you have logged into your FTP using FileZilla. If yes then you are good to go with the following methods.
  2. Look at the very top of Filezilla remote window. i.e in the menu bar and you will be a tab named server.
  3. Click on it and select Force Showing Hidden Files which should be the last option. You should now be able to see all files including ‘hidden files’ within the FTP remote window.

and don’t forget to make the file writeable by changing the permissions to 666. Then repeat the original solution. Don’t forget to change the permissions back to 660. You can also manually add this code in your .htaccess file. If you don’t know how to change the file permission in FileZilla then check out our article on how to change file permission in FileZilla now that you have done all the stupid stuff it’s time to dive in an make our hand dirty. Open .htaccess file and copy and paste this code:

# 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

That’s it you are all done Now your site should be up and running if not then let me know in the comment below. We will try to solve you issue as soon as possible.

Leave a Comment

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