You can use the exclude
parameter:
‘exclude’
(array|string) Array or comma/space-separated string of term IDs to exclude. If$hierarchical
is true, descendants of$exclude
terms
will also be excluded; see$exclude_tree
. See
get_terms()
.
So with your $args
:
$args = array(
'hide_empty' => true,
'title_li' => '',
'show_count' => 0,
'echo' => 0,
// Excludes specific categories by ID.
'exclude' => array( 1, 2 ),
);