get_terms()
got an upgrade in WordPress v4.6 so you can use the news WP_Term_Query
class instead. You can use this to simply exclude the ID of the term archive
so that it never becomes part of your results to begin with. So say the ID of archive
is 5:
$args = array(
'taxonomy' => 'category',
'exclude' => 5,
);
$term_query = new WP_Term_Query( $args );
if ( ! empty( $term_query->terms ) ) {
foreach ( $term_query->terms as term ) {
// What you want it to do
}
} else {
echo 'Term Not Found';
}
The 'exclude'
argument can be an array too so if you wanted to exclude IDs 5, 10, and 15 you just replace 5
with array( 5, 10, 15 ),