[WordPress] Remove author, category, and tag title prefixes
How to remove author, category, and tag title prefixes from your WordPress theme.
Add the below code to your themes funtions.php file:
/**
* Remove archive prefix title
**/
add_filter( 'get_the_archive_title', function ($title) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = '' . get_the_author() . '' ;
}
return $title;
});
You can also expand this code to include custom taxonomies and terms, etc.