WordPress

How to Redirect Your 404 Page to the Home Page in WordPress

Do you need to redirect your 404 web page to your property web page in WordPress?

Redirecting the 404 ‘Not Discovered’ web page to your web site’s residence web page may help cut back your bounce charge and permit your customers to find different helpful content material in your web site.

On this article, we’ll present you learn how to redirect your 404 web page to your property web page in WordPress.

How to Redirect Your 404 Page to the Home Page in WordPress

Why Redirect Your 404 Web page to Your WordPress Dwelling Web page?

When a consumer tries to go to a web page that doesn’t exist in your WordPress website, WordPress will present them a 404 error web page as a substitute.

The wording and look of this web page can fluctuate relying on the theme you might be utilizing.

Default WordPress 404 page

Most customers who land on the default 404 web page will depart your web site shortly. This could enhance your general bounce charge and negatively influence your search engine rankings.

That’s why you need to take the time to create a custom 404 page. Nonetheless, till you try this, you’ll be able to take the shortcut on this tutorial and redirect customers to the homepage.

In an ideal world, you’d additionally redirect specific 404 error requests to essentially the most related pages.

That being stated, let’s have a look at learn how to redirect all 404 errors to your property web page. We’ll cowl two strategies and in addition present you learn how to create customized redirects for particular person pages:

Technique 1: Redirect All 404 Errors to the Dwelling Web page in WordPress

For this methodology, we shall be utilizing All in One SEO for WordPress (AIOSEO). It’s the greatest WordPress Web optimization plugin that permits you to arrange redirects, optimize your content material for search engines like google and yahoo, and extra.

The very first thing that you must do is set up and activate All in One Web optimization (AIOSEO). For extra particulars, see our step-by-step information on how to install a WordPress plugin.

Notice: There’s a free version of All in One Web optimization, however we shall be utilizing the Professional model since Redirect is a Professional addon.

As soon as the plugin is activated, that you must go to All in One Web optimization » Redirects.

Should you haven’t arrange redirects but, then it’s essential to click on the ‘Activate Redirects’ button.

Activating Redirects in All in One SEO

This can set up All in One Web optimization’s Redirects module.

Subsequent, you’ll need to click on on the ‘Settings’ tab on the high of the web page. This web page permits you to configure redirects in AIOSEO.

The AIOSEO Redirects Settings Page

You should scroll down the web page till you discover the ‘Superior 404 Settings’ part. Allow this part by merely clicking the toggle button in order that it turns blue.

Now it is possible for you to to see some extra settings. It’s best to toggle the ‘Allow default 404 redirect’ button to the on place. After that, be sure that the ‘Dwelling Web page’ possibility is chosen.

Enabling Default 404 Redirect in AIOSEO

Discover that there’s additionally a ‘Customized URL’ possibility. This lets you redirect 404 errors to any publish or web page. Don’t overlook to click on the ‘Save Modifications’ button on the high or backside of the web page to retailer your settings.

Now when your guests attempt to go to a URL in your web site that doesn’t exist, they are going to be taken to the house web page as a substitute of seeing the default 404 web page.

Technique 2: Redirect All 404 Errors to the Dwelling Web page Utilizing Code

Should you favor to not use a plugin, then you should use a easy code snippet to redirect all 404 pages to the homepage.

On this methodology, that you must add code to your WordPress recordsdata. Should you haven’t finished this earlier than, then see our newbie’s information on pasting snippets from the web into WordPress. You might also prefer to see our information to the WordPress theme template hierarchy.

First, you’ll need to create a brand new file in your WordPress theme folder and identify it 404.php. In case your theme already has a 404.php file, then it’s essential to edit that file as a substitute.

To edit this file, that you must hook up with your WordPress hosting account with an FTP shopper or their file supervisor device.

FTP 404 php file

As soon as you might be linked to your web site, it is possible for you to to see the 404.php file in your WordPress themes folder.

You should add the next code as the primary line in your 404.php file:

<?php
header("HTTP/1.1 301 Moved Completely");
header("Location: ".get_bloginfo('url'));
exit();
?>

Subsequent, save the 404.php file and reupload it to your theme listing utilizing FTP or your internet hosting management panel.

Now, when a web page just isn’t discovered, as a substitute of seeing a 404 web page, guests shall be redirected to your WordPress residence web page.

Bonus: Set Up Customized 404 Web page Redirects With AIOSEO

The very best and most Web optimization-friendly method of dealing with 404 errors is to redirect guests to essentially the most related web page, not simply your homepage.

The All in One SEO plugin’s Redirects function can even observe all 404-page errors and allow you to arrange good 404-page redirects in WordPress.

Should you put in and activated AIOSEO if you adopted Technique 1, then all that you must do is navigate again to the All in One Web optimization » Redirects web page and click on on the ‘Settings’ tab.

Subsequent, scroll down till you see the ‘Logs’ part. Your 404 logs are a file of URLs that your guests have tried to make use of to go to pages that now not exist in your web site.

Be sure the ‘404 Logs’ is toggled on in order that it appears to be like blue. You may as well select how lengthy you need the plugin to file your logs by choosing the time interval from the dropdown menu.

Enable 404 logs

Don’t overlook to click on ‘Save Modifications’ earlier than shifting on.

After that, you’ll be able to click on the ‘404 Logs’ menu choice to see the final accessed 404 web page.

Bear in mind, because you simply enabled logging, it might not show something immediately. You would possibly want to attend as much as 24 hours earlier than you see any helpful insights there.

Click 404 logs menu option

The ‘URL’ column will present you the pages customers tried to go to however don’t exist.

You’ll be able to redirect any of those URLs to an current web page by clicking the ‘Add Redirect’ hyperlink within the ‘Redirect’ column. This can open a dropdown the place you’ll be able to enter your redirect data.

For greatest outcomes, that you must enter essentially the most related web page for the unique question within the ‘Goal URL’ field after which click on ‘Add Redirect’.

Add home page redirect

For instance, for those who deleted a tutorial on how to start a WordPress blog after which wrote a brand new one, then it’s greatest to redirect that outdated URL to the brand new weblog publish fairly than your homepage.

So as to add a number of 404-page redirects, merely observe the identical steps as above.

Bear in mind, typically, you don’t need to redirect your 404 web page to your property web page perpetually. It’s an ideal momentary resolution till you create a custom 404 page design that can convert higher or arrange particular person redirects that take customers to a related web page that does exist.

We hope this text helped you discover ways to redirect your 404 web page in WordPress. You might also need to see our ultimate WordPress SEO guide and the best drag-and-drop WordPress page builders to create customized 404 pages.

Should you appreciated this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You may as well discover us on Twitter and Facebook.



Leave a Reply

Your email address will not be published. Required fields are marked *