How to Fix 404 Error on WordPress Posts and Pages (3 Methods)

The WordPress 404 error is one of the most common errors you will find on the internet. But that doesn’t make it any less annoying or harmful when it appears on your website. The good news is that fixing it is relatively easy, and the process is well documented for WordPress websites.

In this article, we are going to walk you through three ways to fix the WordPress 404 error:

  1. Reset your .
  2. Restore your .
  3. Deactivate your themes and plugins.

However, before we get down to business, we are going to spend a few moments explaining how the 404 error works and what its most common causes are. Go for it.

How to fix error 404 – Video

Don’t have time to read? Find out how to fix the 404 error on a WordPress website with our video tutorial.

Subscribe for more educational videos!
academy

What is the WordPress 404 error (and why does it appear)

The 404 error appears when you try to access a page and your browser cannot find it. Depending on the browser you use, the message may vary slightly in its presentation. Firefox, for example, shows you a “404 not found” error. Chrome, on the other hand, displays a message that says “404. That is an error.”:

While these default error messages can be pretty vague, any website can set up their own custom 404 error page. This is not strictly necessary, but it allows them to explain to visitors that the site is working, and the only problem is the specific page they are trying to access.

Regardless of how they look, there are many things that can cause a 404 error in WordPress. These include:

  • A misspelled URL. In some cases, the error can be as simple as an extra letter typed into the page’s URL.
  • Caching issues. Sometimes your browser may cache the page you’re trying to access while it was inaccessible, so you’ll still see the 404 error even if your site works for everyone else.
  • A problem with your domain name server (DNS) settings. Your domain may not have propagated to the DNS you’re using yet, so you’ll see the error when trying to access one of your site’s pages.
  • Compatibility issues with WordPress. In some cases, issues with a plugin or theme can affect how WordPress generates URLs and permalinks for your website. So if someone tries to access a URL that no longer works, a 404 error is thrown in WordPress.

It is important to understand that the 404 error is not unique to WordPress. It can arise regardless of the platform your website uses. However, if you use WordPress you have an advantage: there are many ways to solve the problem. We are going to talk about what to do if you find yourself facing a 404 error in WordPress.

See also  How to buy a domain: complete guide

How does the 404 error affect the SEO of your website?

We are human so from time to time mistakes can be made during the programming process. But, you should keep in mind that the 404 error can provide a negative user experience and affect your ranking.

If Google detects many errors of this type on a website, it will consider that the site lacks maintenance and care and, therefore, its positioning will decrease.

To avoid all these problems, you can create a 404 error page capable of convincing the user to continue browsing your website, with buttons, calls to action and even a search engine, if possible.

What to do before fixing the 404 error in WordPress

In the following sections, you will have to edit some files in the WordPress backend. We’ll walk you through the entire process, so nothing should go wrong. However, whenever you are about to edit sensitive files in WordPress, it is important to backup your website beforehand, just in case.

If you don’t have access to your WordPress dashboard right now, don’t worry. At , there are several ways to make one from the hosting control panel.

After that, you’ll want to download and set up a File Transfer Protocol (FTP) client. We recommend , which is open source and offers all the features you’ll ever need. If you have never used FTP before, you can inquire about how to directly access your website. Then, when you’re ready, you can get to work fixing those WordPress 404 pages.

How to Fix 404 Error in WordPress (3 Methods)

In some cases, page not found errors in WordPress soon go away on their own. This usually happens if they are caused by an error with your web hosting provider. Before you start troubleshooting in earnest, we recommend that you try force updating your website, but not before giving it five to ten minutes to fix itself.

If the error persists after that, it’s safe to assume there is an underlying problem with your website. In that case, let’s go through three possible solutions one by one.

1. Reset your WordPress permalinks

One of the most common causes of the WordPress 404 error is a problem with the way WordPress generates . As you may already know, WordPress offers several options for formatting your links to blog posts and pages. For example, you can configure the platform to use simple number links or set the name of each post as its URL:

In any case, the first thing you’ll want to do when encountering a 404 error on a WordPress post is to reset your permalinks. There are two ways to do this, one via desktop and one via FTP. If you have access to your desktop, you’ll want to follow the rest of the instructions in this section. Otherwise, you should skip to method number two.

See also  Basics of using WP_Query in WordPress + examples with code

If you can access the desktop, start by going to the tab Settings > Permalinks. Once there, make a note of the structure your site is currently using. You’ll need to temporarily change it to reset your WordPress permalink settings, but it will revert back to the way it was after a moment.

For now, select the option Simple in Common Settings and click the button Save at the bottom of the page:

The page will reload. Then you can go ahead and choose the type of permalinks previous, and save the changes once more. That’s all it takes to reset your WordPress permalink structure.

Now try browsing your website as you normally would. Take a look at the pages that were previously throwing WordPress 404 errors and see if they persist. If the error is gone then pat yourself on the back, you fixed it first time!

2. Restore your WordPress .htaccess file

When you make changes to your WordPress permalink structure, they are saved to a file called . That particular file controls how WordPress interacts with its server, as well as how it generates the URLs for your pages.

If you don’t have access to the dashboard due to the WordPress 404 error, you’ll need to edit .htaccess manually to reset your permalinks. To get started, go to the folder root of WordPress. This is the directory that contains your WordPress installation, and is commonly found in a folder called public_html either wwwor bear the name of your website:

Open that folder and find the file .htaccess within. If you are using FileZilla, right click on the file .htaccess and select the option that says View/Edit (View/Edit). What it does is download a copy of the file to your computer and open it using your local default text editor. Now you can make the changes you want.

If you don’t understand everything the code in this file does, don’t worry. You should not make any changes unless you are sure of what you are doing. However, what if you can to do is use the default WordPress code .htaccesswhich looks like this:

# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php # END WordPress

is a file .htaccess default, no modifications. That means it will remove any changes made to your permalink structure. Make a backup copy of the contents of your old file .htaccess now, and replace it with the above code snippet.

After that, save the changes to your file .htaccess using a text editor and close it. FileZilla will ask you if you want to replace the file .htaccess existing with the copy you just edited. Say you agree, and that’s it! You just reset your WordPress permalinks manually, without damaging anything in the process.

See also  How to Create a WordPress Forum (In 3 Easy Steps)

At this point, try to access WordPress again. The 404 error should be gone, which is great news. However, you’ll still want to return your permalink structure to the way it was before, unless you like numeric URLs for your posts.

Remember that you can change the appearance of your permalinks by accessing your dashboard and navigating to the tab Settings > Permalinks. Once there, simply choose the structure your website was using before the whole 404 debacle started and save your changes. Then everything should be back to normal.

3. Disable WordPress themes and plugins

As we mentioned earlier, sometimes your plugins and themes can affect the WordPress URL structure, depending on their settings. If you tried one or both of the above methods and the WordPress 404 error still persists, disabling your themes and plugins is your best option.

There are two ways to do this, depending on whether you have access to the desktop or not. Yes you have access, go to the menu Plugins > All plugins and follow this process with each of your plugins:

  1. Click the button Deactivate below the plugin name.
  2. Check your site to see if the 404 error persists.
  3. If the error is still there, re-enable the plugin you deactivated.
  4. Move on to the next plugin on the list and repeat the process.

Your goal here is to rule out each plugin as suspicious, one by one. You can disable them all at once, but in most cases, it is only one plugin that causes the problems. If disabling one of your plugins fixes the problem, you have three options. You can see if an update is available, keep the plugin temporarily disabled until there is an update, or uninstall it and find an alternative.

If you’ve checked all of your plugins and none of them are at fault, you’ll also want to make sure your active theme isn’t behind the 404 error. This process is much faster since you only need to check one theme. Go to the tab Topics and change your active theme to something else:

Now, check if the WordPress 404 error is gone. If so, you again have to choose between checking for an update or finding a new theme. Change WordPress themes…

Loading Facebook Comments ...
Loading Disqus Comments ...