Exclude Category from WordPress Category Widget

Glenn Blog 0 Comments

Here is a WordPress snippet to exclude a Category from displaying in the Native WordPress Category Widget. Simply add this tour your functions.php file in your theme:-

// Exclude Category from Native WordPress Category Widget
function exclude_widget_categories($args){
$exclude = "1,2,4"; // The IDs 1,2,4 of the excluding categories
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","exclude_widget_categories");
About the Author
Exclude Category from Wordpress Category Widget 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g

Glenn

A highly experienced Web Developer (WordPress, Webflow, Weebly & Custom), Front-end / Back-end Developer & New Media Specialist, with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries, built up over a number of years.