Hide widgets from the review and policies page side bar

Add the below code in the functions.php file of your current active theme –

add_action('widgets_init', 'remove_search_widget_for_reviews_url');

function remove_search_widget_for_reviews_url() {
    if (strpos($_SERVER['REQUEST_URI'], '/reviews/') !== false || strpos($_SERVER['REQUEST_URI'], '/policies/') !== false) {
        unregister_widget('MVX_Widget_Vendor_Product_Search');
    }
}

Leave a Reply