How to Fix Http 404 Error - Not Found on WordPress Website

How to Fix Http 404 Error – Not Found on WordPress Site

How to Fix Error 404 - Not Found on WordPress Website

There are many potential errors you might see on your WordPress website and Error 404 Not Found is one of the common ones.

But that does not mean it is not frustrating when you or your visitors try to browse your site and keep running into the Error 404 Not Found message.

That is the last thing you want for first time potential customers to see of your brand.

How to Fix Http 404 Error - Not Found on WordPress Site

A 404 error can also be an indicator to you that something has changed or moved and a 301 redirect probably needs to be added for SEO purposes.

In this post we are going to help you get your site working again by explaining a few things:

What is the Error 404 Not Found?

Whenever you or any of your visitors go to your website, your browser sends a request to the web server and receives back data including something called an HTTP header. The HTTP header includes HTTP status codes to explain what happened with the request.

Most of the time the request works perfectly and you will never actually see the HTTP status code but if something goes wrong then your web browser will usually display a message with the HTTP status code to indicate the exact problem.

Just like other error messages -500 error, 502 error, 504 error, etc the Error 404 Not Found message is the result of that process.

What Does Error 404 Not Found Actually Mean?

Basically it means that the client – your visitor’s or web browser was able to successfully connect to the host – your website’s server but it was unable to find the actual resource that was requested like a specific URL or filename.

For instance If you try accessing a specific URL like a domain.com/what-is-WordPress and if no content carries that name then you will get a 404 error message.

What Does Error 404 Not Found Actually Mean

This error has absolutely nothing to do with your server -it just means the requested file such as image, page, JavaScript, CSS or post is missing.

When a 404 error message pops up it simply means the server cannot find the file the user requests.

What Causes Error 404 Not Found on WordPress?

Some of the common causes of 404 errors are as follows:

  • A mistyped URL.
  • Caching problems.
  • An issue with your Domain Name System (DNS) settings.
  • WordPress compatibility issues.

If you get this error on the entire sites content then it is typically due to an issue with your WordPress site’s permalinks.

However if you only see it on certain individual pieces of content then it is most likely because you changed a piece of content’s slug without setting up a redirect.

This means that the content accessible at the Web address URL you have just accessed does not exist or no longer exists.

what causes http 404 error

The difference between the two can often help a user find the right URL if they use common sense.

As a webmaster you need to correct the link as soon as possible because it may risk losing a very large majority of visitors and sales – who are not going to bother doing if they cannot access your product page or blog article or other by any other means.

The consequences can be devastating for both the traffic on the site and for the turnover of an online store therefore you must be vigilant and watch this closely to correct any 404 errors as soon as it occurs.

To monitor this Google Search Console will be ideal and saves time in corrective actions. We strongly recommend you to use 404 broken link finder tools mentioned below in this article.

Error 404 Not Found Variations

Because each web browser displays error messages differently – you might see a different message for this error.

Other common variations include:

  • Error 404
  • 404 Not Found
  • HTTP Error 404
  • 404 – file or directory not found.
  • ERROR 404. PAGE NOT FOUND On WordPress site
  • The requested URL was not found on this server.
  • The page cannot be found
  • We can’t find the page you are looking for.
  •  The requested URL was not found on this server
google 404 not found page

The Error 404 Not Found message is also unique in that many sites will actually create a custom page to address the error rather showing one of the messages above.

Some WordPress themes also include custom 404 pages by default. For that reason you might not actually see the error message at all because many sites will use funny or creative 404 pages instead.

custom error 404 not found page

If you create a 404 Error Page – try to include a search box and some of your recent blog posts to help visitors find what they might be looking for. Always include search functionality on your 404 page.

Error 404 Not Found Impact on SEO

Error 404 Not Found does not have any inherent negative impact on SEO. But it might have a negative impact depending on the reason for why the error is happening.

For example -if a visitor just mistypes a URL and sees a 404 error then there would not be a negative impact on SEO.

no negative impact on seo

But if you have individual errors because of broken URLs then that will inhibit Google’s ability to properly crawl your site and this can have a negative SEO effect in that way.

Additionally if a permalink issue is causing site wide 404 errors then Google would not be able to crawl any of your site’s content. In other words always fix your 404 errors as soon as possible.

Error 404 Not Found Impact on Site Performance

Many sites do not realise that generating a lot of 404 errors can easily run into performance issues since these responses are not cached especially on larger sites.

To minimise the impact of 404 requests on site performance you need to automatically cache 404 pages for 15 minutes.

If you create a new page with the same URL as the cached 404 page then you need to automatically purge the cache so your visitors will be able to see the new page immediately.

minimise error 404 impact on site performance

This means your site will be protected from Hypertext Preprocessor – PHP and CPU spikes caused by traffic to dynamic 404 pages.

You are probably generating more 404 errors than you think and using the appropriate tools can help you determine the exact amount.

For example – a certain site is missing some mobile icons such as /apple-touch-icon.png.

These are most likely in a theme or plugin’s code that is getting queried but the actual icons were never added therefore the server generates a 404 error as it cannot find the resources.

WordPress is a flexible platform – no doubt but its flexibility can be a double-edged sword. Sometimes doing too much can overtake some settings and the whole hell breaks loose, random errors start appearing and your site goes down.

Luckily because WordPress has so many users therefore finding help is not difficult. 

How to Fix Error 404 Page Not Found in WordPress?

We will cover a couple different methods for how to fix the Error 404 Not Found message depending on whether it is happening site wide or to specific content.

Because this error discloses inconsistency with a link therefore it can resolve the same by properly configuring and saving WordPress permalinks.

You should also correct the linking structure using a .htaccess file.

how to fix error 404 page not found

1. Update Your Permalinks

It is a simple solution to fix 404 error in WordPress by saving WordPress permalinks. This will update .htaccess file with the correct configurations for WordPress website.

The easiest way to fix this is to update your permalink settings through the WordPress dashboard via WP-login or WP-admin.

wordpress wp admin

All you need to do is go to Settings → Permalinks. 

permalinks settings

Then scroll down and click on Save Changes. You do not need to make any changes – clicking Save Changes is enough.

save settings

Now try accessing the posts to see if the 404 error is fixed.

If saving the permalinks did not solve the 404 issues then you can manually reset permalinks by editing the .htaccess file.

To do this you need to access WordPress files using FTP or cpanel. When connected via FTP locate .htaccess file and edit it.

manually reset permalinks ia htaccess files

Add in one of the following codes, save and upload the updated file to your server:

If site is on the main domain – e.g. www.yoursite.com then add this code to .htaccess file:

adding code

Or copy and paste below:

# 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

After editing and uploading a new file, refresh your site and access posts/pages to see if this fixes the 404 issues.

B. If WordPress Site in a Subdomain

If your site is installed in a subdomain like a blog.yoursite.com then use this code instead.

if wordpress is in a sundomain

Or copy and paste below:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

C. When WordPress in subdirectory

If your site is on a subdirectory like as – www.yoursite.com/blog then edit .htaccess to include this code instead.

when wordpress is in subdirectory

Or copy and paste below:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

3. Set Up 301 Redirects for Moved or Renamed Content

The 301 redirect is the most effective solution for correcting 404 errors on your site.

However it must be done correctly to redirect to the right pages as appropriate:

  • The page with error 404 has been replaced on the site by a new page which has a different URL: We are redirecting directly to this new page.
  • The page with error 404 has not been replaced on the site: We are redirecting to a page with similar content. If no similar content exists then it is also possible to redirect to the category page of the old content. As a last resort- redirect to the home page but do not do this systematically.
  • Before deleting a page and redirecting always ensure to check if it has backlinks or external links, visits and if it is still well-positioned in Google.
set up 301 redirects for moved - renamed contents

To begin -you can use a free Redirection plugin to fix redirects from your WordPress dashboard. After installing and configuring the plugin visit the Tools menu and select Redirection and then type the 404 page URL in the Source URL box and the new working URL in the Target URL box.

how to start redirection in wordpress

Manually in the .htaccess of your hosting panel via cpanel – using the piece of code:

  • To 301 Redirect a Page:

RedirectPermanent /old-file.html http:// www.domain.com/new-file.html

  • To 301 Redirect an Entire Domain:

RedirectPermanent / http:// www.new-domain.com/

Once you have inserted the commands to 301 redirect your pages you need to ensure that there is a blank line at the end of the file.

Your server will read the .htaccess file line by line which means you need to throw an end line character to signify that you are finished.

An easy way to do this is to put a blank line at the bottom of the file.

Now that you have cleaned up your 404 errors – you can now anticipate this type of problem by creating a well-designed custom 404 page.

You can get inspiration from Google which offers different original creations than others.

Edit .htaccess

You need to edit the .htaccess file and add a snippet of code at the top which can be done in a number of ways. You can either get it done through an FTP program’s edit mode or edit the file on your PC and then upload it to the server via FTP or you can do this via cPanel >> File Manager.

This is the code:

manual 301 redirection via htaccess files

Or copy and paste below:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./index.php [L]

# END WordPress

While you can do your best to prevent 404 errors by using the tips above it is impossible to entirely eliminate 404 errors because some things are just plain outside your control. It is not uncommon for small WordPress sites to have thousands of 404 errors every month.

For example – if a visitor mistypes the URL or if another website links to a page that does not exist then people are going to get 404 errors no matter what.

To provide a more user-friendly error page you can use one of the many 404 page plugins.

create your own error 404 page not found

For example the free 404 page plugin lets you set up a custom 404 error page with:

  • A search box
  • Important links
  • Contact information

Another important feature of the 404page plugin is that it does not create redirects. A 404 page should never be redirected to a physical page such as yoursite.com/404.

The 404 error should always be generated dynamically on the page in question.

By including these elements you are providing your visitors the tools they need to find their way to the right page.

Always remember – keep your 404 page light for better performance and only include what is absolutely needed.

How to Monitor 404 Errors Going Forward

Going forward it would be beneficial to pay attention to which requests are causing 404 errors at your site.

This can help you:

  • Find broken links that are sending people to a non-existent resource which could be internal links or external links. You want to do your best to fix those links if it is all possible.
  • See which pages Google is having trouble crawling. You want to figure out why Google is trying to crawl a non-existent page and set up a redirect if needed.
  • Troubleshoot issues and improve performance with regards to 404 errors.
how to monitor 404 error going forward

Use Google Analytics Tools

For example – you could trigger the following event on load of the error page:

ga(‘send’, ‘event’, ‘error’, ‘404’, location.pathname);

With the help of Google Analytics, you can set up a custom report to track 404 errors from external links.

404 error using google analytic tool

Using Google Search Console

You can track 404 errors that Google’s crawlers encounter in Google Search Console.

Once you have verified your site with Google Search Console – go to Crawl → Crawl Errors → Not found to view a list of 404 errors that Google has encountered.

This is by far one of the easiest ways. It is also the best in terms of performance because it requires no third-party plugins or additional scanning against your site.

track 404 error with google search console

Google’s bots are already crawling your site on a regular basis so why not simply take advantage of the data they already provide? 😉

This can also help you to improve the user experience and the visibility of your website.

In most cases these solutions will fix the WordPress posts 404 error.

Use WordPress Plugin

If you want to use a WordPress plugin the abovementioned Redirection plugin can help you monitor for 404 errors from your WordPress dashboard.

Use Third-Party Audit Tool

You can also use a third-party audit tool like Ahrefs to monitor for 404 errors on your WordPress site. You can even set this up to run on a schedule.

ahref to track 404 error

To check every link on your website to determine whether the link leads to a 404 error, you can use broken link crawl or scan tools like:

Use Free broken link checker / dead links tools

error404.atomseo  – A free web-based online tool for checking broken or dead links (404 errors)

broken link checker - atomseo

Dead Link Checker: Free Broken Link Checking Tool

dead link checker

Broken Link Checker – Free Broken Link Checker Tool

broken link checker

Dr. Link Check: Broken Link Checker

Dr link checker

Hexometer – Broken Links Scanner for 404 or Dead links

hexometer

Conclusion

Unfortunately http 404 errors will happen on your site whether you like it or not.

The larger your WordPress site is the more you will start seeing this. We recommend getting a good workflow together for how you monitor these types of errors and go about fixing them.

404 errors are never good for visitors, your brand or business and Google definitely does not like to see them either.

For full Web Hosting Services package functionality

and select the package that suits your business needs.

If you prefer to discuss your requirements first just

or fill your details with a message of your requirements at

Further Reading: Benefits of SEO

For more information about our services and how we can help you with your Web Hosting needs:-

Join Our Blog Email List

I might send you 1 or 2 emails a month. Most probably less. Lots of tricks, tips, humour hacks, guides and exclusive ramblings in there for your good mental health and education.

limited time offer - time sensitive
education

You can unsubscribe anytime whenever you like. No risk or regrets. We will never spam your Inbox.

Hope you are enjoying and learning a lot with abundance of information about:-

How to Fix Http 404 Error – Not Found on WordPress Website.