FastComet WordPress 404 Error

How to Fix Error 404 Not Found on Your WordPress Site

Of all potential errors that can be found on your WordPress website, Error 404 is one of the harmless ones. However, this type of error can be frustrating both for you and your website visitors. Stumbling upon Error 404 is not something that you want your first-time visitors to experience. A 404 can be an indicator for some changes, and that you should add a 301 redirect for SEO purposes.

This post is to clear some things up and help everyone get their WordPress site working correctly again. We will cover:

What is the Error 404 Not Found?

When a visitor goes to your website, then their browser will send a request to the webserver. The browser then receives data that includes something called HTTP header. This header contains HTTP status codes that explain the request status.

The request works perfectly most of the time, and an HTTP status code is never seen. So, if something goes wrong, then the web browser displays a message with the HTTP status code. This is to indicate a particular problem and The Error 404 Not Found message is the result of that whole process.

The Meaning Behind Error 404

In general, the error means that the client (yours or your visitor’s browser) succeeded when connecting to the host (the site’s server), but it couldn’t locate the requested resource (a URL or a filename).

For instance, if anyone tries accessing www.example.com/post-name, but there isn’t any content with the slug post-name, then the visitor will see a 404 error. That is because the requested resource doesn’t exist, although the server functions correctly.

It is not only regarding posts or pages. Any missing asset could potentially generate a 404 server error (an image file that’s missing, missing CSS, JavaScript, etc.).

What can Cause the 404 Error?

If you see the 404 Error on all of your website’s content, it would typically mean an issue with the permalinks of your WordPress website. You might see the error only on separate pieces of content. In that case, it is probably because of some changes that you have made without setting up a redirect.

The 404 error is not necessarily bad – it’s negative only when it’s interfering with the usability of your WordPress website. Remember that sometimes there are things out of your control and that’s no reason to panic.

For example, it is possible that someone types a false URL in their browser’s address bar. In such a case, they would see a 404 error, but there wouldn’t be any actual problems with your WordPress site and the way it’s configured. A 404 error is the actual desired response in this scenario, and you can even make your customized 404 web page to help visitors get to their destination.

Variations of Error 404 Not Found

Different browsers often display error messages in various ways. Thus “Error 404 Not Found” also has different variations, such as Error 404, 404 Not Found, HTTP Error 404, Not Found, Page Not Found, The requested URL was not found on this server, etc.

Many sites would create their custom 404 Error page to address the error. Also, there are some WordPress themes that include their own custom 404 error pages by default. This is why you might not actually stumble upon the message itself because many sites play around with it and make it funny in a creative way.

Below you can see an example of our 404 error page at FastComet:

FastComet 404 Custom Page - Lost in Space

We include two buttons in it – one to go back to the home page, and another to report the issue. We also offer up to 20% discount in case it’s an actual bug that we missed, and you find it for us. If that’s the case, thank you in advance!

The Impact of Error 404 on SEO

The error does not have an actual negative impact on SEO, but keep in mind that it depends on the reason for Error 404 happening. For example, if you have individual 404 errors because of some broken URLs, instead of someone just mistyping the URL, that will constrain Google from correctly crawling your website, which would lead to a negative SEO effect. So, we recommend the fixing of errors 404 as soon as possible.

The Impact of Error 404 Not Found on Site Performance

Websites generating lots of 404 errors are more likely to have performance issues, as such responses are not usually cached. It can be a massive problem if you promote or accidentally get a surge of traffic on a 404 error page.

You can check the Avoid HTTP 404 post, which is a part of our GTmetrix tutorial. GTmetrix is one of the most popular websites for analyzing web pages that potentially need optimization. There are two different Score Scales to use, which offers diversity in all analyzed pieces of content. The scores you would get in PageSpeed, and YSlow categories would be based on generalized rules that might not apply to your content.

You can check all 404 errors in the Google Search Console or choose to install a plugin like Redirection, which would log all 404 errors. Keep in mind that such plugins often impact your website performance.

The reason these errors are bad is that a lot of 404 error pages are resource-intensive. For larger WordPress sites, it’s best to avoid the heavy 404 pages. You should make a simple 404 template to avoid querying the database.

How to Fix the 404 Error on WordPress?

Below, we will cover some methods on how to fix the 404 Error, depending on whether it happens only on a specific piece of content, or sitewide. Here are the two methods:

In case you experience 404 errors sitewide when trying to access your WordPress site’s content, the most likely cause would be a permalink issue (or your .htaccess file, when using the Apache web service). The easiest fix for that is an update to your permalink settings through the WordPress Dashboard. All you have to do is go to SettingsPermalinksSave Changes (you don’t have to make changes – just clicking the button is enough):

Save Permalinks Changes in WordPress

This action will update the permalinks settings, as well as flush the rewrite rules. In most of the cases, this is a solution that fixes the WordPress posts 404 error. 

With that in mind, if the solution does not work for you, you have two actions – to find the cause via a debugger plugin or to use FTP for some manual action.

Find the Cause via Debugging

First and foremost, try to disable plugins that handle the redirections or create customized permalinks. If that doesn’t solve the problem, use a debugger and view the rewrite array and confirm for you that the rewrite rule for processing your URL is not in its place. To do this, go ahead and install the plugin called Debug This, which helps with viewing what is actually in the WordPress rewrite array.

Once the Debug This plugin is installed and activated, go to your WordPress site and navigate to HomepageAdmin BarDebug ThisQueryRewrites:

Going to Debug This Plugin - Query - Rewrites

You should end up on a screen containing rewrite rules on its left-hand side and the PHP string being rewritten on its right-hand side. So, let’s say that you have a broken author feed (example: https://www.myblog.com/author/myself/feed/). You want to troubleshoot the broken feed, so go ahead and look for the word “author.” The following rule should be found: author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$

If you are not seeing the rule, this is the source of your issue. WordPress simply does not process requests unless it knows exactly what it is doing.

The actual PHP URL string that WordPress uses for this author feed is: http://myblog.com/index.php?author_name=myself&feed=rss. If this PHP URL does not work, you have another problem with your WordPress site.

This would be a case where you want to start deactivating plugins one by one and see if you can find the conflicting PHP that’s responsible for the issue.

Using FTP for Fixing the 404 Error

To use FTP for fixing the 404 Error, login to your server using FTP, and then modify the .htaccess file, located where folders like /wp-content/ and /wp-includes/ are. In case your permissions are 660, and you are not the owner of the file or part of the group, the easiest thing to do is temporarily making the file writable by changing the permissions to 666. After that, repeat the original solution. Make sure that you don’t forget to change the permissions back to their default. Your other option is to manually add the following code in your .htaccess file:

# 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

Set Up 301 Redirects For Renamed or Moved Content

When experiencing 404 errors only on a particular piece of content, you are most likely facing one of the following issues:

  • Changed the URL slug for the particular piece of content;
  • Moved the content manually, e.g., by deletion of the existing post and then pasting it into a new one.

In those cases, users are most likely to try accessing the content where it was located previously, which would result in a 404 page instead of what they expected. The easiest fix for this is an automatic redirect for anyone that tries to access the previous location to the new one. This way, they will make it to their destination and will not be frustrated with your website. It’s also vital for SEO. In case you decide to rename or move a post without the addition of a redirect, you will lose all the authority that’s attached to the pointed backlinks at that particular post.

By default, WordPress would try redirecting any changed/moved content. However, it does not always work, and you should not rely on WordPress for this specific functionality. With that said, there are some ways to set up your redirects in WordPress:

You can use the free Redirection plugin for managing redirects from the WordPress Dashboard. Once the plugin is installed and activated, go to ToolsRedirection and input the 404 error page URL in the Source URL box with the new location in the Target URL box. 

Use cPanel for Redirects

You can also use the cPanel for managing redirects. Using the cPanel is what you should prefer since you are doing the redirects on a server level, which won’t have an effect over your site’s performance, which also means one less plugin to worry about.

If you are a FastComet client, it means that you are using the Apache server. In that case, you have the option to use .htaccess to set up redirects. 

Fix WordPress 404 Error (Internet Explorer)

At times, your WordPress site would be working correctly on all browsers, except for Internet Explorer. That’s because IE ignores the 404 conditions since its birth. However, Microsoft had introduced a system update that can result in stopping the 404 error page on your WordPress website instantly, even if the website sends valid content back.

The solution is quite simple. All you have to do is put the following code in the header.php file that is located in your theme folder:

header('HTTP/1.1 200 OK');

How to Create Your “Error 404 Not Found” Page

Even if you do your best to prevent 404 errors by following the right tips, it’s near impossible to eliminate every possibility of a 404 error on your WordPress website. Keep in mind that it’s not uncommon even for small WordPress sites to have hundreds or even thousands of 404 errors on a monthly basis. This happens because of URL mistypes and incorrect redirects of other websites to yours.

You can use plugins for creating your own 404 page. Offering a more user-friendly error page, the free 404page plugin gives you the opportunity to set up your custom 404 error page with:

  • A search box
  • Important links;
  • Contact info;

One more essential feature of the plugin is that it doesn’t create redirects. A 404 Error page should not be redirected to a physical page. The 404 error always needs to be generated dynamically on a particular page.

With these elements included on a 404 page, you will be giving visitors the tools that they need if they wish to find their way to the page they are looking for. However, don’t forget to keep your Error 404 page as light as possible if you want better performance. Only use the features of absolute necessity.

How to Monitor 404 Errors Going Forward

Going forward, it’s absolutely beneficial that you pay some special attention to which requests the 404 errors on your WordPress site. The following can help you:

Find the broken links (we recommend using GTMetrix) that are sending people to a non-existent resource, which could be internal or external links from other websites. If possible, you should do your best to fix all broken links.

See which are the pages that Google is having trouble crawling. Afterward, you need to figure out the reason why Google is trying to crawl a non-existing page. You should also set up a redirect if that’s necessary.

Option 1 – Google Analytics

If you use Google Analytics, you can set up your custom report, tracking 404 external link errors. We have a helpful tutorial on How to Integrate Google Analytics.

Option 2 – WordPress Plugin

We have already mentioned the Redirection plugin. It can help you with monitoring for 404 errors right from your WordPress Dashboard.

Option 3 – Third-Party Audit Tool

There are many third-party audit tools on the internet. Some of them are Screaming Frog, Online Broken Link Checker, Dead Link Checker, etc. Choose the one you like the most and try it out, if you want to go with that option.

Option 4 – Google Search Console

You can track 404 errors that Google crawlers encounter in the Google Search Console. After verifying your WordPress site with the Google Search Console, go to CrawlCrawl ErrorsNot found. You will see a list of 404 errors that Google has encountered. This is one of the easiest methods. It doesn’t require third-party plugins, and it also does not need further scanning against your website. This is the reason it’s the best for performance. The Google bots are already crawling your website regularly. Why not take advantage of the information they already provide?

Final Thoughts

Keep in mind that 404 errors will be happening on your site—it’s almost inevitable. The larger a WordPress site grows, the more 404 errors it will have. We recommend you to get a good workflow for monitoring those types of errors and proceed with fixing them. The 404 errors are not pleasant to visitors, your brand, and search engines don’t quite like to see them too.

We hope this was a helpful article. If it did not work for you, you can always contact our technical support experts via submitting a support ticket.

Do you have any suggestions that we did not list? We will be glad to hear them in the comments below. Our goal for this post is to be as comprehensive as possible, and we are always open to suggestions.

Joseph

Joseph is part of the FastComet Marketing team. With years of content writing experience behind him, it's one of his favorite activities. Joseph takes part in the SEO of the FastComet website and blog. His goal is to write comprehensive posts and guides, always aiming to help our clients with essential information. Joseph also has a thirst for knowledge and improvement, which makes the hosting environment a perfect place for him.