WordPress: Hide the default category on the front
To be placed in the functions.php file:
add_filter( 'list_terms_exclusions', 'global_cat_exclude' );
function global_cat_exclude( $terms ) {
if( !is_admin() )
$terms = "AND t.term_id != " . get_option( 'default_category' ) . " ";
return $terms;
}
Repr...
TB
Written by
Thomas Bourdin
Published on May 13, 2014
Updated on August 20, 2026
1 min read
To be placed in the functions.php file:
add_filter( 'list_terms_exclusions', 'global_cat_exclude' );
function global_cat_exclude( $terms ) {
if( !is_admin() )
$terms = "AND t.term_id != " . get_option( 'default_category' ) . " ";
return $terms;
}
Reproduce this customization today
The principle of the hook remains useful, but the administration screens and WordPress APIs have evolved since the publication. Test the code in a staging environment with the exact version of the site's core, theme, and plugins.
Save the files and the database before making any changes.
Control user capabilities, nonces, input validation, and output escaping.
Place customizations in a dedicated plugin or a child theme to preserve updates.
Reference: official WordPress plugin development manual .
TB
About the author
Thomas Bourdin
Technical Management · Technical Project Manager
With more than ten years at partITech, Thomas Bourdin has built his career at the intersection of software development, architecture and the management of tailored digital projects. Now leading technical management and working as a technical project manager, he supports clients from functional scoping through production launch, then coordinates product evolution, maintenance and long-term reliability. His approach combines business understanding, technical rigour and a focus on robust, maintainable solutions.