Get multiple term IDs by slug, and then exclude them in get_terms

You can get terms, from multiple slugs, with the slug argument:

$exclude = get_terms ( 
    [ 
        'slug'     => [ 'president', 'vice-president', 'admin', 'rnd' ], 
        'taxonomy' => $cat_type,
        'fields'   => 'ids',
    ] 
);

where we use the fields argument to return only term ids.

Leave a Comment