How to Remove “Archive:” & “Category:” Titles from WordPress

Discover how to remove the word “Category:” from your archive or category subpage in WordPress! 🚀

Embracing WordPress means diving deep into its features. One of the fundamental elements of posts is their category, but that’s not all. There are also tags and other kinds of taxonomies.

The default WordPress installation lets you leverage these, but taxonomies are labeled in the title as “Archive:”, or “Category:”, etc.

On the category page, the H1 title also includes the word Category, which, for most, is a big SEO no-no, leading many to opt out of using or displaying archive pages. But, there’s a workaround!

How to remove the word “Category:” from an archive or category subpage in WordPress?

I’ve got a simple trick for you. Just add the snippet below. How to add code to WordPress?

add_filter( 'get_the_archive_title', 'tr_archive_title' );
 /**
 Remove archive labels.
 @param  string $title Current archive title to be displayed.
 @return string        Modified archive title to be displayed.
 */
 function tr_archive_title( $title ) {
 if ( is_category() ) {
     $title = single_cat_title( '', false );
 } elseif ( is_tag() ) {
     $title = single_tag_title( '', false );
 } elseif ( is_author() ) {
     $title = '' . get_the_author() . '';
 } elseif ( is_post_type_archive() ) {
     $title = post_type_archive_title( '', false );
 } elseif ( is_tax() ) {
     $title = single_term_title( '', false );
 } elseif ( is_home() ) {
     $title = single_post_title( '', false );
 }
 return $title;
 } 

This code (snippet) will remove those unnecessary taxonomy pre-titles. As a result, your category page won’t have the “Category:” prefix. So, say goodbye to those pesky pre-title inserts and hello to cleaner, SEO-friendly titles! 🎉

Did you know that by sharing this article you are helping me? Thanks for your support.
Tom Robak
Tom Robak

Tom Robak is a digital expert with over a decade of experience, specialising in WordPress, SEO, e-commerce, and optimising web performance. His unique skill set, rooted in sales, marketing, and photography, establishes him as a leading creator of customised online solutions.

Grab Your Web Wonders Digest!

Join my newsletter adventure for exclusive WordPress tips, SEO secrets, marketing insights, and some fun stories directly in your inbox!

One comment

  1. Dzięki! To mi się napewno przyda bo strasznie mi się to nie podobało, ale nie miałem pomysłu jak zmienić nazwy kategorii, żeby było ładnie i SEO. 🙂

    MIĘCHO

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready for your new website?

Feel free to book a free consultation, or just drop me an email. I'm excited to chat with you!

Free initial consultation

Write an email