Skip to content

Instantly share code, notes, and snippets.

@glennyboy
Created February 27, 2021 16:26
Exclude Category from WordPress Category Widget
// 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");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment