How to exclude categories from Category widget in functions.php

Add the following function in functions.php of your active (child?) theme and adjust the category ID numbers:


function mo_exclude_widget_categories($args){
 $exclude = "1,3,4"; 
 $args["exclude"] = $exclude;
 return $args;
}
add_filter("widget_categories_args","mo_exclude_widget_categories");

 

Leave a Reply