Posts randomly returning 404 Errors
This is very frustrating but a fairly common issue with WordPress especially when you are logged in as the Admin and working in the admin area of your site.
There are number of reasons why this may be happening. Let’s work through these and how to fix them.
Permalinks
This issue can happen if your .htaccess file was somehow deleted or edited with incorrect data. To fix this you need to do update your permalinks settings:
- Go to Settings » Permalinks
- Click on Save Changes button
That’s it! You have just updated your permalinks settings and flushed the rewrite rules.
Now return to where you were having those issues and see if you are no longer getting 404 errors.
If all is well then you’re good to go. If not, let’s have a look at the .htaccess file directly.
.htaccess file
Now let’s look at updating the .htaccess file manually.
- Login to your server using FTP (we use and recommend filezilla).
- Navigate to the root folder of your WordPress installation – this is where you will see folders like wp-content, wp-plugins and wp-includes, as well as other wp related files.
- Here you should see the .htaccess file. First try to temporarily make the file writable by changing the permissions to 666. Then repeat the permalinks solution and check for improves.
- If all is well then change the permissions for your .htaccess file back to 660 and you are done
- If not, then you need to open the .htaccess file and edit it in a code editor (we use and recommend notepad++) and manually add the following code to it:
# 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
This should fix the issue of random 404 errors while in Admin mode.