How to Fix WordPress 404 Error – Page Not Found [Tutorial] Best of 2021

How to Fix WordPress 404 Error – Page Not Found

For a very big CMS platform like WordPress, it is possible to get 404 Error. It can even occur due to a minor change. Here in this blog, you will get to know how to fix WordPress 404 error in posts and pages.

As the articles posted by the admin of a WordPress site are called posts and pages are like posts. Pages can be managed in a hierarchical structure in WordPress.

Here CMS also known as Content Management System is a system which allows users to easily create, edit, organize and publishing content.

WordPress 404 Error is an error message that you encounter when a web page that you are trying to access could not be found on the server. In other words, we can say it is generated by a server when any particular URL is not found.

Server is a software which receives your request for accessing a web page. It runs only a couple of security checks on your HTTP request and takes you to the web page.

how to fix wordpress 404 error

WordPress is a great software package to use which is very convenient for the users who are not familiar with coding.

But sometimes you face a message showing on your screen “404 ERROR PAGE NOT FOUND” or “WordPress not found the requested URL” while using site.

Now if you get any 404 error message then you don’t have to get stressed as it is a very common problem that users face while using WordPress. In this article, we will provide you all the essential information about how to fix WordPress posts returning page not found error. So keep reading!!!

Ways to Fix WordPress 404 Error

This type of error may occur due to the .htaccess file or something wrong that happened to the rewrite rules. You just have to update the permalink settings and modify the .htaccess file. Where .htaccess (hypertext Access file) is the configuration file of a website.

This configuring file used to run Apache Web Server software. Any alteration in this file can cause an error.

Here are the steps through which you can remove a page not found error in WordPress.

Reset Permalink

Now the question arises that What are permalinks? Permalinks are the permanent URLs to your individual pages and blog posts. The URL to each post should be permanent, and never change to be known as permalink.

To fix url with 404 error in wordpress you have to update your permalinks settings and change rewrite rules. There are two methods through which you can reset these permalinks.

1st method

  • Login to your account and go to the admin dashboard.
  • Go to settings and Click on permalinks.
  • Select the plain radio button option.
  • Scroll down and click on Save Changes.

Now your permalinks have been reset and you won’t find any 404 error message and you can check your posts, pages, and images.

If this method doesn’t work then you can try another method in which you can do these changes manually given below.

2nd Method: Do it manually

If you need to reset permalinks manually then you have to access and edit your .htaccess file which is located in the root of your site. You can access your .htaccess file through SSH, command line, FTP or cPanel.

As FTP stands for File Transfer Protocol. It is a “means of transport” i.e. it is used to transfer files from one local computer to a remote website, such as a WordPress blog.

Also cPanel is also known as control panel which is basically a web hosting panel based on Linux system and provided by many hosting providers.

It provides a website all the automation tools to simplify the process of hosting a website.

There are two ways through which you can edit your .htaccess file in WordPress manually:

  • First way is to download a copy of your .htaccess file and then modify it in a text editor which is compatible. Here as an editor, users have the authority to edit, write, publish, and delete posts. This includes posts which are written by other users. Then re-upload it on your site by replacing the original .htaccess file.
  • Second way is to use SSH or FTP client such as Filezilla to modify your .htaccess file directly on your server and then click on Save Changes.

# BEGIN WordPress

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

# END WordPress

Fix Custom Post Types

In this, you have to check if your custom post types have unique titles and slugs. If any two or more posts have the same title then they need to be altered.

Just a single post/page can contain the same slug or URL. So make sure to change the URL of the 404 error page in WordPress. Otherwise, it will show 404 error message on the screen.

Still, Getting the WordPress 404 Error?

If you tried the above methods and still you are getting an error message then you need to troubleshoot the issue further. This error may occur due to your theme. So To resolve this error just try another theme to install and activate it. To get resolve your 404 Error follow the steps:

  • Activate the WordPress twenty-seven theme.
  • Go to the Appearance tab and click on themes.
  • Click on activate when you find the WordPress default theme.
  • Now if you don’t find any 404 error message on your screen then your theme was creating this 404 error problem.
  • And If you still find the error then switch to your previous theme and deactivate all the plugins. This might help you to remove the 404 error.

Change and update WordPress URL in the database

If you encounter any 404 error message saying that “The requested URL was not found on this server. If you entered the URL manually, please check your spelling and try again.”, then follow the steps given below:

  • Go to your database name and Choose wp-option.
  • Now change the URL like your website URL is replace it to http://localhost/blog

 Redirect 404 error page to homepage

If you didn’t want your 404 Error page you can also redirect the 404 error page to the homepage in WordPress To do this you have to install some plugins like Redirection, 404page or you can also do it manually by adding some line of code in you 404.php file. Follow the steps to redirect 404 error post or page to homepage:

  • open your 404.php file in your theme’s folder.
  • If it not found then create a blank php file.
  • Now paste this code on that file.

header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: “.get_bloginfo(‘url’));

And now its done. if any user open this URL it will be  redirected to the homepage.

Get in touch with our support team

If the above methods are not at all useful and you are still having trouble in resolving 404 error then don’t panic.

Our support team is just one call away to help you. You can contact our professional experts and they will listen to you and will try to provide effective solutions to your problem.

For any Technical help and support Dial, WordPress customer service number +1-855-945-3219.

Also Read:
11 essential tips to ensure your WordPress Security
4 Simple Way to Backup Your WordPress Site
WordPress Maintenance – An Advance Guide
8 Signs Indicating Your WordPress site Hacked

Leave a Reply

Call Us