Problems with the meta title of CPT archive page


I would like to delete the term “Archives:” from the meta title of CPT archive page. I would like to do this from functions.php, without using any plugin. Unfortunately, I have not found anything relevant about this topic. Any help?

Thanks in advance!

add_filter('wp_title', function ($title) {
   if (is_archive() && get_post_type() == 'your-cpt') {
      return str_replace('Archives: ', '', $title);

   return $title;

But, for future reference as this is not Roots related, something like this would better be left to Stack Overflow.

1 Like