WordPress

How To Fix WordPress 404 Page Not Found error

By: 

Sushil Pradhananga

Published On : 

March 8, 2023

WordPress 404 page not found error

When a page or post cannot be found on your WordPress website, the ‘404 not found error‘ is displayed, which means your requested URL was not found. This error 404 page can occur unexpectedly or following modifications to your WordPress site. This is one of the most basic and irritating types of error in WordPress websites.

Fortunately, rectifying this error is a simple process that requires no technical expertise. In this guide, we will outline the steps involved in resolving 404 errors for posts in WordPress.

While WordPress is an incredibly versatile platform, its adaptability can also be a source of challenges. In some cases, when you modify too many settings, unexpected errors may arise, and your website may crash. There are various tricks and tips to fix error 404 not found error on the WordPress page, which we are going to discuss below.

What does error 404 not found mean in a WordPress site and what causes error 404

When a user gets a 404 error message, it indicates that the server cannot locate the file that has been requested.

For example, if you attempt to access a particular URL (such as domain.com/what-is-WordPress) and there is no content associated with that name, a 404 error message will be displayed.

This error is not related to the server itself, but rather, indicates that the requested file (whether it be an image, page, or post) is missing.

The precise wording of the error message may vary slightly depending on the browser being used. For instance, Google Chrome may display the message “404. That’s an error. The requested URL /~ was not found on this server. That’s all we know.”

How to Fix WordPress 404 error page not found on your website

If you’re encountering a “404 error page not found” with your WordPress posts, it typically means there’s an issue with your links. To resolve this, it’s often possible to fix the problem by ensuring that your permalinks are correctly set up and saved. Setting up the permalinks will definitely help fix error 404.  Additionally, you may need to reset your linking structure by modifying your .htaccess file to fix this issue.

1. Saving Permalink structure to Fix 404 error page not found in WordPress

Most of the time solution for WordPress error 404 not found is to save the permalink from the WordPress dashboard.

Updating the permalink form WordPress dashboard will automatically update the .htacess file with the correct configuration that is needed for the URL structure to work perfectly for your WordPress website and to get rid of 404 error in WordPress.

In order to save your permalink,

  • first log in to your WordPress backend and hover over the setting menu from the sidebar menu, on hover submenus are displayed where the Permalinks menu can be seen please click on it.
permalink-menu

  • Once you reach the permalink page, you can get various options for permalink structure, please check the Post Name option and click the save changes button at bottom of the page.
permalink-save


This should most of the time solve the 404 not found error.

2. Manually Reset Permalinks to fix 404 error on your WordPress site

In case the WordPress error 404 persists even after saving the permalinks, you have the option to reset it manually by modifying the .htaccess file. To achieve this, you need to access your website files using FTP. Once you have connected through FTP, navigate to the .htaccess file and modify it accordingly.

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

a) Reset permalinks when your site is in the main domain

If your site is on the main domain, e.g. www.yoursite.com, add this code to 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

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

b) Reset permalinks if your site is in a subdomain and fix WordPress 404 Error

If your site is installed in a subdomain, such as blog.yoursite.com, use this code instead.

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) Reset permalinks when your site is in a subdirectory

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

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

To effectively fix the 404 error page not found on your site, the most suitable solution is to implement a 301 redirect. However, it is crucial to ensure that the redirection is done correctly and the pages are redirected to the appropriate pages.

  • In cases where the page with the error 404 has been replaced on the site with a new page that has a different URL, a direct redirection to the new page is necessary.
  • If the page with the 404 error has not been replaced on the site, redirecting to a page with similar content is recommended. If no similar content exists, redirecting to the category page of the old content can be an option. As a last resort, redirecting to the home page is also possible, but this should not be done systematically.
  • Before deleting a page and implementing a redirection, it is essential to check if the page has backlinks (external links), visits, and if it is still well-positioned in Google.

If you are using WordPress, you can utilize a free Redirection plugin to assist with fixing redirects. After installation and configuration, you can navigate to the “Tools” menu, select “Redirection,” and enter the 404 page URL in the “Source URL” box and the new working URL in the “Target URL” box.

Following is the screenshot of the steps to be followed :

redirection-plugin-install
redirection-setup
redirection-plugin-install-step2
redirection-plugin-install-step3
redirection-plugin-install-step4
redirection-plugin-install-step5
redirection-plugin-install-step6
adding-redirection-process



How to Create Your custom 404 error Page on your WordPress website

Although it’s advisable to follow the above tips to minimize 404 errors, it’s impossible to entirely eliminate and track 404 errors as certain factors may be beyond your control. It’s common for small WordPress sites to encounter thousands of 404 errors each month. You can create a user-friendly error page to let users know you have landed on a page that doesn’t exist.

To enhance the user experience and make specific pages more user-friendly, you can utilize one of the numerous 404-page plugins available. For instance, by using the free 404-page plugin, you can customize a 404 error page to create your own custom 404 page instead of a broken page. You can include features such as a search box, important links, and contact information in your custom 404 error page besides showing the error 404 not found message, to make the page more interactive.

However, it’s important to remember to keep your 404 page light to improve overall performance.

Tools to Check and Monitor 404 Errors WordPress

By taking a proactive approach, it is essential to examine which requests are causing 404 errors on your website. This can assist you in:

Identifying broken links that redirect visitors to an unavailable page returning 404 error on your site. Eventually, you can take remedial action to repair such broken links.

Determining which pages or content are having difficulty being viewed by Google crawlers. Then, you can make necessary adjustments, primarily by implementing a redirect.

Resolving problems and enhancing performance related to WordPress 404 not found errors.

There are various tools available to monitor 404 errors on your website:

  • Google Search Console allows you to view a list of 404 errors encountered by Google on your site. To access this feature, sign up for an account, verify your website, and navigate to Crawl Errors >> Not found.
  • Google Analytics tracks and reports 404 errors. To use this tool, sign up for Google Analytics and start tracking.
  • If you prefer a WordPress plugin, the Redirection plugin can help you track 404 errors from your WP dashboard.
  • Third-party audit tools such as Ahrefs are also effective in monitoring 404 errors on your WP site.

Humming Web

Let’s talk about your business goal and align the solution we provide with our digital marketing services.

FREE strategy call

© Humming Web. All Rights Reserved