How to Redirect Not Found Error Pages to Homepage in WordPress

0

Hello Visitor,

In WordPress we often delete old posts or pages that don’t matters or violates any laws, that results in increase in 404 pages in Search Results and decreases website rankings.

Mostly people use plugins to avoid these problems and redirect 404 pages to any other url or homepage.

But i am here to provide you a simple and efficient method to redirect all not found traffic to homepage of your website.

For WordPress:

  • After logging to WordPress admin panel.
  • Go to Appearance > Editor (This Opens Editor for WordPress Current Theme used)
  • Then on the right side there is a list of different file names having extension .php mainly)
  • Find the file named 404 Template (404.php)
  • Open it.
  • Delete all its content.
  • paste below given code onto it. (change url to your own homepage)

    <meta http-equiv=”refresh” content=”0;url=https://www.hashhackers.com” />

  • Click on Update File.
  • Your Not Found Traffic is now redirected to your homepage.

For HTML or PHP website. (Editing in File Manager of Hosting Account):

  • In Root Folder of your Website (where index.html or index.php is held).
  • Create a file named 404.shtml
  • paste the code here and change url to your domain name.

    <meta http-equiv=”refresh” content=”0;url=https://www.hashhackers.com” />

  • Your Not Found Url’s are redirected to Homepage now.

Note: You can also use specific url to redirect to instead of Homepage.

Having Problems? Comment below.


Join our Facebook Page: Click Here

Join our Facebook Group: Click Here

You might also like More from author

Leave a Reply