Here’s the way to hide any specific categories from the WordPress category widget. You just need to add the following code in your functions.php
As you can see there are two types of 1) for the default Categories Widget and 2) for the Categories Widget to “Display as dropdown”
/* this removes the categories from the list */
function remove_widget_categories($args){
$exclude = "14";
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","remove_widget_categories");
/* this removes the categories from the dropdown */
function remove_widget_dropdown_categories($args) {
$exclude = "14";
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_dropdown_args","remove_widget_dropdown_categories");
If the above code doesn’t work, there may be a plugin or theme conflict that’s preventing the code from working.