error 404 wordpress

How to Fix 404 Error in WordPress

Last Updated on April 24, 2022 by WP Knowledge Hub

Since almost 40% of all websites are built with WordPress, it’s very common that you’ll come come across a 404 error, also known as a missing page.

Usually occuring when a user browsing your website clicks on a link to a missing page, WordPress will automatically respond with an error message, for example, “404 Not Found”. Of course, WordPress allows for custom 404 pages, but that’s beside the point.

How do you make sure users don’t see the 404 missing page error, either from your website or a link from Google?

WordPress 404 Page Error

If your home page is showing you a 404 missing page error, it’s typically because your WordPress settings are wrong.

Navigate to Settings > Reading > and make sure that the “Your homepage displays” setting is set to either “Your Latest Posts” (likely if your website is a blog), or that the Homepage that’s chosen in the “A static page (select below)” setting actually exists or is the correct page you want to show as your website’s landing page.

Sometimes after changing the .htaccess file, some sub-pages can go missing (they are still there, just inaccessible). In order to reset them, you simply need to re-save your permalinks.

Go to Settings > Permalinks > and re-save (leave everything as-is).

Then, check your .htacess for any suspicious code. If you’re not using a caching plugin, your .htaccess should look like 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]
# END WordPress 

Fix WordPress 404 missing pages from Google links

If Google or any other search engine has indexed a missing page that you deleted and your users are clicking on that link from a search engine, they will get the 404 missing page error as well.

In order to fix these links, you can either wait a very long time until Google re-indexes the proper link (not recommended) but this is bad for SEO!

Instead, use a redirection plugin to point the old link to a new link!

The best redirect plugin is Redirection by John Godley. Two million + users can’t go wrong!