In WooCommerce, I am trying hide a specific product in the Woocommerce product widget.
I found a solution to exclude it via category:
function exclude_widget_categories($args){
$exclude = "11,10,8,7,9"; // IDs of excluded product categories
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","exclude_widget_categories");
But thats not what I want. I need it for a specific product with the id 2386.
How to hide a specific product in woocommerce product widget?