Below is the code that you can add to the functions.php file of your active theme to exclude one or more categories from the default WordPress category widget.
function exclude_widget_categories($args){
$exclude = "1,4,8,57,80"; //Add your category ids here
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","exclude_widget_categories");View or fork this snippet on GitHub Gist.
Need this done on a live site? Exivon Tech takes on projects and audits, led by me.


