redirect shop page to home page in website
-
we want to redirect shop page url to home page
Hi kidsdial4,
Thanks for reaching to us and appreciate your patience.
Go to WooCommere > Settings > Products tab and unset Shop page.
Best Regards,
I have changed in settings where you have said to “home retail” from “shop”, than home page not loaded properly, so i reverted. https://imgur.com/a/caMeZ1W please check and resolve it from your side
Please check my last comment. in this comment, i have attached shop page url so that when someone try access the url , it should redirect to home page of website
Hi kidsdial4,
Please add this code to the functions.php of the child theme:
function custom_shop_page_redirect() {
if( is_shop() ){
wp_redirect( home_url('/') );
exit();
}
}
add_action( 'template_redirect', 'custom_shop_page_redirect' );
Regards,
yes, if i use this code, it ll help me to redirect “shop” page to “home page” , but than our “search” will not work. if we enter any text and hit “search”, it ll redirect to home page.
so please give me an another solution.
Hi kidsdial4,
Yes, of course.
Search products functionality will redirects you shop page to show products.
Unfortunately, customization is out of our basic support.
Thanks for understanding our limitations. Let me know if you have any questions.
Regards,