Some WordPress themes output ‘Category:’, ‘Archive:’, in front of the name of that particular taxonomy or archive. It’s not the most beautiful thing to have on most websites, not to mention unnecessary.
Use this snippet to remove the prefix on those pages. It removes the prefix from:
- Category pages
- Tag pages
function remove_category_text_from_archive_title($title) {
if ( is_category() || is_tag() {
return single_cat_title('', false);
} else {
return $title;
}
}
add_filter('get_the_archive_title', 'remove_category_text_from_archive_title');