Hello,
There are more ways you can achieve this:
- You can add custom CSS to Go to Appearance → Customize – Custom/Additional CSS section, this code -> div.taxonomy-category.wp-block-post-terms {display: none;}
- Use a function to hide uncategorized category, by adding it to your theme’s functions.php file ->
function remove_uncategorized_category() {
$categories = get_categories( array( 'exclude' => array( 1 ) ) ); // Replace 1 with the ID of your uncategorized category
wp_set_object_terms( get_option( 'page_on_front' ), array_values( wp_list_pluck( $categories, 'term_id' ) ), 'category' );
}
add_action( 'init', 'remove_uncategorized_category' );
3. Or just add a new category name and assign it to your post, then the post will show some other name instead of uncategorized.
I hope you find this helpful, kind regards.