Sunday, October 25, 2020

Woocommerce: Disable Default Shop Page

 /**

 * DISABLE DEFAULT SHOP PAGE

 */


function woocommerce_disable_shop_page() {

    global $post;

    if (is_shop()):

    global $wp_query;

    $wp_query->set_404();

    status_header(404);

    endif;

}

add_action( 'wp', 'woocommerce_disable_shop_page' );

No comments: