0

Redirect Woocommerce Multisite shop page to another URL

By 9th November 2016Blog

Here’s a snippet to switch a Multisite Woocommerce store from one store shop page to another.  Handy when you point your store Shop page to the main store from a subsite shop page.  You may have done this in the menu, but if you use breadcrumbs then this will still show the current site store page. This snippet added to the top of your PHP template file will redirect automatically to any URL you prefer.

$blog_id = get_current_blog_id();
if ( $blog_id == 2 ) { //  or any other site ID you prefer
if ( is_shop() ) {
wp_redirect( '/main-store', 301 );
exit;
}
}
Phil

Phil

I'm a Wordpress web developer and website designer based in Cheshire, UK. I specialise in Wordpress, Responsive design and website conversion. | Twitter | Linkedin

Leave a Reply