Home > Help Center > Applications > WordPress > WordPress 404 Error

WordPress 404 Error

In this article we will show you how to remove the 404 Page Not Found error in WordPress. Keep in mind that we are simulating a technical problem when clicking on a link to actually existing posts and pages.

Just for the test, let's delete the .htccess file in the WordPress root directory and click on a few links:

error 404 not found

Only our home page works, while clicking on any link returns the above error.

Our first step is to log in to the administration and click Settings > Permalinks:

error 404 not found

Then on the Permalink Settings screen we need just to press Save Changes button once.

Click Visit Site link and click on any post link:

error 404 not found

When we check the file structure we see newly generated .htaccess file on the place of the deleted one containing this code:


BEGIN WordPress

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

END WordPress


Of course this error was triggered intentionally just to demonstrate how WordPress rebuilds the missing or damaged .htaccess file.

In another test we removed part of the .htaccess code and after rebuilding permalinks structure .htaccess were also totally rebuild.

If because of wrong directory permissions WordPress is unable to rebuild .htaccess file you must do it manually by using CPanel File Manager, or by uploading new .htaccess file using FTP, or by using SSH.

Let's show you one more interesting thing – WordPress links can work without .htaccess.

In Permalink Settings screen select Plain radio button:

error 404 not found

Click Save Changes button.

Now delete again the .htaccess file and visit the site – all links are working fine because URLs are not been rewritten but are accessed by their ID:

error 404 not found

If you are deleting a popular but out-of-date post, consider deleting the body of the post, and replacing it with a link referring visitors to the new page.


We hope this article will help you to quickly fix any problem with 404 error on your WordPress site.

Check your site for broken links, also make sure your theme contains 404.php error template to show user friendly content when users click on a link to a missing content.

If the theme does not contain custom 404.php file WordPress will use index.php file but your users would hardly be impressed.

#wordpress #settings

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support