add_filter('pre_get_posts', 'excludeCat'); function excludeCat($query) { if ( $query->is_home ) { $query->set('cat', '-4'); } return $query; }