How to Fix WordPress Posts Returning 404 Error (In 4 Steps)

You’ll want to follow these steps in order and check if the error has been resolved after each one.

The first step to try is resetting your permalinks. Head to your WordPress dashboard and navigate to Settings > Permalinks.

The WordPress Permalink Settings page.

From here, just click on Save Changes. That’s right — you don’t actually need to edit anything. Clicking that button will update the permalink settings even if you don’t make any changes. This is important because it also refreshes the rewrite rules used for “pretty permalinks.”

With this done, go ahead and reload the pages you were trying to access. If everything works, you’re all done. If you still get a 404 error, head to the next step.

Step 2: Restore Your .htaccess File

If resetting your permalinks didn’t work, the next strategy is restoring your .htaccess file. This controls how WordPress interacts with the server and how it generates permalinks for your pages. Restoring it to the default settings can fix sudden 404 errors.

To restore the .htaccess file, you’ll first need a way to access it. If you’re using Hostinger hosting, you can use the built-in file manager found in the Hostinger control panel. Most other web hosts offer a similar feature, or you can use a Secure File Transfer Protocol (SFTP) client such as FileZilla.

# 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 is the default .htaccess file for WordPress.

Restoring this file will also reset the permalink settings for your WordPress site. Therefore, if you’re using a custom permalink structure (or have changed it at all from the default), you’ll need to restore that setting too.

To do so, head back to your WordPress dashboard and navigate to Settings > Permalinks (just like Step 1 above). You can change it to whatever you were using before and then save it.

Finally, refresh your website and attempt to load the pages that were returning 404 errors. If everything works now, congratulations! If not, proceed to the next step.

Step 3: Disable All of Your WordPress Plugins and Theme

If you’ve reset your permalinks and .htaccess file, but you’re still seeing 404 errors on your site, the next step is to check your plugins and theme. Plugins, in particular, can sometimes have bugs or compatibility issues that prevent a site from loading.

Let’s start there. The basic idea is to disable them one by one and then check your website. If the error persists, turn it back on and move to the next one.

To get started, head to your WordPress dashboard and navigate to Plugins > Installed Plugins.

The ‘deactivate’ button on the WordPress plugin settings page.

Locate and click on the Deactivate button below the first plugin. You can see that active plugins are shaded blue, while those that are off are white (as you can see with Akismet in the screenshot above). Now, refresh your site and see if the 404 error is still occurring.

If you get the error message, head back to the plugins screen, re-activate the plugin you just tried, and move to the next one in the list. If you find one that resolves the issue, you can check for updates that may resolve the problem or find an alternative with similar functionality.

If none of the plugins prove to be the issue, it’s time to try changing your theme. Head to Appearance > Themes.

The WordPress theme manager.

Your currently-active theme is marked as such. Hover over one of the others and click on Activate. Then refresh your site and try to access the problematic page again.

Note that changing your theme can alter your site significantly. So if you find that your theme is the issue, you may need to spend some time finding one that provides a similar look and features.

Step 4: Set Up a 301 Redirect for Moved or Renamed Content

This one is a bit of a bonus step. If you do actually have content that’s been moved or renamed and thus doesn’t exist anymore at the URL you were using previously, you’ll want to set up some 301 redirects to point that old URL to the new one.

The easiest way to do this is with a WordPress plugin such as Redirection.

Subscribe to Farath Shba

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.