How to Fix 404 Error in WordPress and Why It Happens?

How to Fix 404 Error in WordPress posts and pages? Many a time it is found that you are going to visit a post, a page, or a site and the browser shows a 404 not found error. Displaying this not found 404 is an HTTP Status code that sends the server to the browser and it implies that the server cannot fetch what you send to the server as an HTTP Request.

Do you know How to Fix 404 Error in WordPress?
How to Fix 404 Error? Why It Happens and How to Find out?

Error 404 not found is a common error that you can see frequently when you are going to visit a website, click a link, a page, or a post but your targeted URL is either not available or moved to a new location. Many times, website owners change the URLs of pages and posts but they do not redirect them. Under such circumstances, visitors will see a 404 page not found error because the server looks at the old URLs whereas you have moved them to new ones.

Visitors will see such kind of 404 error unless you redirect URLs properly. Sometimes, you may see error 404 on the client side if the targeted page is either deleted or the link you are trying to access is broken. There are many reasons as to why the 404 error happens. The current article gives you a complete overview on how to fix the 404 errors and other aspects of it.

How You Can See 404 Not Found Error?

As a reader, several questions may arise in your mind as to 404 not found error or simply 404 error like how can I see error 404. Some others may ask how 404 errors appear. In how many forms the browser may show it according to the servers’ HTTP Response Code? This may appear in several forms as follows:

  • 404 Not Found
  • Error 404 Not Found
  • Error 404
  • 404 Error
  • 404 Page Not Found
  • HTTP 404 Not Found
  • HTTP 404
  • 404 File or Directory Not Found
  • 404 Not Found Error

All these forms of response codes are related to 404 which the server sends and you can see it on the client side( browser). Before going to learn how to fix a 404 error, you should know what are the variable alternatives to 404 error.

Why does 404 Error happen?

Many beginners want to know when and why the 404 error happens. Indeed! it is a hot question that is related to HTTP response codes which are provided by a server under certain conditions. A 404 error happens when the requested resource is not available, does not exist, moves to a new location, the URL is incorrect, or there happens to be a change in the DNS records.

404 not found error in Google
404 Not Found in Google.

So let’s know why 404 not found happens.

The Resource Is not Available: You can see a 404 not found on your device’s screen if the resource you are trying to reach is not available or not found.

404 not found error with example in Google.

The Existing URL Is Deleted: Sometimes it is found that you are going to access a particular web page or post but the URL of that web resource does not exist or the site owner deleted it. The server will return a 404 not found error to the client side provided that the URL does not exist but you are going to reach it.

How to Fix 404 Error in WordPress and Why It Happens?

As for example, for my site Blowwager.com, there was a URL like” https://www.blowwager.com/block-content-statistics .” But owing to certain reasons, I have deleted that page. If you type this URL on your browser’s tab and hit the search button, the server will return you a 404 not found error which looks as follows.

Error 404 Not Found.

The URL Has Moved or Changed: A 404 happens when the URL of a post or page of your site moves to a new location. It may be that you published an article some years ago but owing to the relevance of your content you want to change the content plus the URL. If you have changed the URL and someone tries to access it over the Internet, the server will return a response code like this “404 page not found”. This happens because the server is trying to fetch the old URL but you have modified it and it has come to a new location. Such kind of error happens until you correct it. No matter to worry about the 404 error. In the latter part, I shall discuss how to fix the 404 error.

Why 404 error happens?

The URL Is Not Correct: There are many reasons as to why a 404 error happens when someone is trying to access a site or web page. 404 not found error happens if the URL that you have typed is incorrect. As for example, the about page for Medium is “https://medium.com/about” but if type it incorrectly like “https://medium.com/about-medium” and hit Enter on your keyboard, it will show the following HTTP Status Code. Actually, 404 not found is displayed on the client side when the server can’t fetch what is requested.

404 not found home page in Medium.
Source: Medium.com

Even you can try this for your site and see what comes out. Suppose you have a site like example.com and it has some pages and posts published on the web, such as about, home, service, product, or anything else. As usual, the URL of your about page is “https://www.example.com/about” and suppose it is correct and you have published it.

Now, if you type it incorrectly such as “https://example.com/about-example” on your browser’s tab and hit enter. The server returns a 404 page not found error.

Change in DNS Records: Another reason as to why the 404 error happens is a change in the DNS record. There are many instances when you need to change DNS records such as updating DNS, changing DNS, adding certain security services, CDNs, etc. As for example, if you add SiteLock to your website and do not update the permalink properly, all the URLs cannot be accessed and your server will return a 404 page not found.

In such kind of occurrence, the domain name is not converted into an IP address.

Server Not Running or Connection Broken: The browser shows you an error 404 not found if the server which hosts your site is not running or the connection is broken.

How to Fix 404 Error?

If you find a 404 error on your website, you have to fix it lest it might harm your site and will have a negative user experience on it. So, let’s learn how to fix 404 errors.

Delete the Browser Cache and Clear Cookies: An HTTP 404 error may appear while you are going to access a web page from a web browser. If the problem appears again and again, you can try it by deleting your browser’s cache and clearing cookies for your site. Once you have deleted the browser cache and cleared cookies, try to access the page showing 404 not found. Also, you can try it from another browser, if needed.

Clearing site cookies and deleting browser's cache are two ways on how to fix 404 error or 404 page not found.

Reload the Page: Another way to fix 404 error is to reload the page after being refreshed it. Sometimes, you can see a 404 error provided that the page does not load properly. If you face such a kind of issue while accessing a page, then refresh the page by clicking on the ‘Refresh’ button from your browser or hit the F5 on your keyboard.

How to Fix 404 Error in WordPress and Why It Happens?
Source: Wikipedia

Use Website’s Search Function: Many websites provide a search function that you can use to find a page or post based on certain phrases or keywords. Just type the keyword that you have targeted into the space provided for the search function and click the button. Based on your input, the website will show you some posts related to your search terms.

How to Fix 404 Error in WordPress and Why It Happens?

Use Popular Search Engines: There are many top search engines that you can use to find out your targeted query. A search engine tells you whether the resource is available or not. Use Google, Microsoft Bing, or whatever you like. Google is the most used search engine in the word

Check the URL and Type It Properly: While typing the URL of your targeted resource, do it correctly. Typing incorrect words lead to typos that result in an unexpected 404 not found error. A single URL may consist of at least 3 words or normally 15-20 letters including internet protocol, domain name, and post title which together constitute a permalink. Be careful when typing the URL on your browser’s tab and check it before clicking the search button. If you write it incorrectly, the Domain Name System(DNS) can’t convert it into an IP address.

How to Fix 404 Error in WordPress and Why It Happens?

Redirect the Old URL to the New One: Redirecting the old URL to the new one is the easiest way to fix 404 not found error. If you don’t know how to fix 404 errors, don’t worry. You can learn it. Just go to the WordPress plugin directory and type the keyword’ Redirect’ in the box provided for conducting a search. Once the keyword typed therein, click the search button and you can see a number of redirect plugins.

Don't know how to fix 404 error? WordPress Redirect Plugin allows you to fix 404 not found error.

You can install and activate the ‘Redirection’ plugin to redirect URLs. You can read our guide on how to install and activate a WordPress plugin.

This is a powerful and popular redirect plugin used by many site owners. After you have installed and activated the plugin on your WordPress, go to Settings>>Redirects.

How to Fix 404 Error in WordPress and Why It Happens?

Now, you can see the ‘Add new redirection’ section where you can see the (1) Source URL and the (2) Target URL. Simply, type the old URL in the source box and type the new URL in the target box where the visitors will be redirected.

How to Fix 404 Error(Page Not Found) Using Permalink in WordPress?

So far you have learned how to fix 404 errors by using proper URLs, clearing site cookies, deleting browse’s cache, refreshing pages, and redirecting plugins. All these means and methods are effective to fix 404 pages not found in certain cases. Moreover, you can fix error 404 in WordPress using permalink settings.

Locate the permalink under Settings(Settings>>Permalink) from your WP-Admin dashboard. Click on Permalink and it will take you to that page.

Just set up the permalink settings properly to fix 404 error in WordPress.

Now, you can see that there several options for permalink settings. Check your posts and pages’ URLs to be confirmed as to which permalink settings they have in use. Actually, if there is any change in the DNS Records, your entire site’s URLs will be affected. All the posts and pages may show 404 pages not found.

Under such a kind of occurrence, just check the button to set up the permalink that you selected and saved before. Checking your posts URLs, you can find out it. Once you identified and checked the button for setting up permalink, scroll down and click save. All URLs of your website will be fixed on auto-pilot. Open a new tab on your Windows and check the URLs to know whether it has fixed the 404 error or not.

How to Find Out 404 Error?

You have to find out the pages and posts which have involved 404 errors in order to fix them properly. Always try to minimize it, as it has negative effects on your site’s SEO. You shall find the pages having a 404 not found error in Google Analytics, Google Search Console(GSC), and Bing Webmaster Tools if you have submitted your site to those services.

Login to your Google Search Console account and you can see several menus there on the left side like:

  • Overview
  • Performance
  • URL Inspection
  • Coverage
  • Sitemaps
  • Removal
  • Page Experience etc.

Now, you need to check your site to find out whether there is any page or post having a 404 not found error. So, after logging in to your GSC account, scroll down along the left side until you locate the ‘Coverage’ menu. Click on ‘Coverage’ and it will show you all the pages which are (1) Valid and (2) Excluded. Click on ‘Excluded’ and it will show the pages which are excluded owing to certain reasons like redirect error, marked no index, 404 not found, etc.

Now, click on the ‘Not Found(404)’ to see the pages and posts which have run into a 404 error. Thus Google Search Console lets you inform which URLs have incurred 404 not found errors.

Google Search Console lets you identify which URLs are with 404 not found error.

To find out the pages marked with HTTP 404, log in to your Bing Webmaster Tools account and scroll down until you locate the ‘Site Explorer’ menu. Under this menu, go to the upper part of the page and open the filter box to see the URLs having various issues. Click on the line labeled “URLs with Crawling Issues(dead link-HTTP 404-410)”.

Bing Webmaster Tools too let you inform which URLs  have incurred HTTP 404 error.

It takes you to the URLs having HTTP 404 issues. Now, you can look into the URLs and use proper redirect if needed to avoid a 404 not being found.

Don’t worry if you do not know how to fix 404 error. It’s a common error found both in the internal as well as external links. For an internal 404 error, you have to install a redirect plugin t and redirect the URLs to new URLs. So you have to change the permalink too.

But for external hyperlinks or URLs, you can inform the website owner to correct them as quick as possible. Also, you can remove the external link and add a similar link provided that the links are on your site.

Also, you can check 404 not found using a third-party service like dead link checker which lets you check a single webpage or the whole site. Besides it, you can use Atomseo which offers both free and paid services to find out broken links.

It is binding upon you to fix the 404 page not found to result in a better user experience. Visitors facing too many broken links may get annoyed which may have adverse effects on your site. That’s why I have provided this in-depth article on how to fix 404 errors which you can solve using various ways and tools.