Site icon TheCreatology.com

How to redirect 404 error page to Homepage in WordPress ?

In my previous article I explained about significance of 404 error page in website development. If you missed it, then you can read it here Create 404 Error page to decrease bounce rate on WordPress.

Road block 404 Error, redirect to Home

The WordPress 404 error page is usually custom coded, and hence it can be enhanced as per our requirements and needs. In this article we will learn how to redirect 404 error page to homepage in WordPress.

Redirect 404 error page

Below is a simple procedure to add redirection on 404 error page to homepage of blog.

<!--?php $URL= get_bloginfo('url'); header("Location: $URL"); ?-->

We are done!

Adding the above code, will redirect any visitor to Blog’s homepage, if encountered any error or broken links. In a way it can be modified to set custom link as well. only thing is you need to edit line number 3 and add the custom like after “Location: http://www.thecreatology.com”.

If you think its complex then you can hire me for this virtual assistance.

Exit mobile version