Currently my page titles are handled by WordPress, in a call to wp_head (I have add_theme_support( ‘title-tag’ ) in functions.php). I’d like to change the page title format for category archives – currently these look like
<Category name> Archives - <Site name>
I’d like them just to be:
<Category name> - <Site name>
Is there a way of achieving this?
If you’re using the Yoast SEO plugin (which it looks like you are) then this answer might help you
If you are using yoast SEO plugin then the easiest method is to remove
the archive word from “titles & metas-> Taxonomies->category”
find:
%%term_title%% Archives %%page%% %%sep%% %%sitename%% replace it with:
%%term_title%% %%page%% %%sep%% %%sitename%%
Alternatively you could try changing it using the get_the_archive_title
filter as explained here
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="<span class="vcard">" . get_the_author() . '</span>' ;
}
return $title;
});