How to Fix 404 Error in WordPress

How to Fix 404 Error in WordPress

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 404 error in WordPress Posts and Pages.

A 404 error is an error message that you encounter when a web page which 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.

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” while using WordPress.

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 404 error. So keep reading!!!

Ways to Fix WordPress 404 Error

This type of error may be occur due to .htaccess file or something wrong happened to the rewrite rules. You just have to update the permalink settings and modify the .htaccess file. Here is the steps through which you can remove 404 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. 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.

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.  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 same slug or URL. So make sure to change the URL of 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 be 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 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 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 https://www.xyz.com/blog replace it to http://localhost/blog

 Redirect 404 error page to homepage

If you didn’t want your 404 Error page the you can also redirect 404 error page to 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.

<?php
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: “.get_bloginfo(‘url’));
exit();
?>

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 888 614 0555.

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