Skip to content

How to remove "Category:" in title from category pages

By default, the category pages display title in format "Category: Category Title". Showing "Category:" in title is redundant and is not beautiful. To remove "Category:" from the title, you need to add some code to your theme. This post is about to do that.

The problem of the category title

Here is the screenshot of the category title in TwentySeventeen theme (the default WordPress theme):

Category title in 2017 theme

Category title in 2017 theme

If you're on the category page, it's better to show only the category title (without the word "Category:") or a breadcrumb like Home → Travel. That provide a clear information to users to show where they are. You can see a good example of removing category title in our recent theme Floral. Keeping everything short and clear is always better.

How to remove "Category:" from category title

It's easy to do that. Simply open the functions.php file in your theme and add the following code at the end of the file:

function prefix_category_title( $title ) {
    if ( is_category() ) {
        $title = single_cat_title( '', false );
    }
    return $title;
}
add_filter( 'get_the_archive_title', 'prefix_category_title' );

Now refresh your category pages and you will see "Category: " is gone.

If the theme you're using is a premium WordPress theme, you shouldn't edit the functions.php file directly. Because you will loose all the edits when it's updated. Instead of that, you should use a child theme to do the job. To create a child theme, please follow this guide.

After creating the child theme, put the code above in the functions.php file. It works similarly. And you never loose the change when the theme is updated.

25 Comments

  1. Miodrag Miodrag on September 26, 2017 at 11:14

    Super, it did the job!

  2. Viaggio in Germania Viaggio in Germania on October 11, 2017 at 19:43

    Great, thanks, it worked perfectly.

  3. Frodo Frodo on October 16, 2017 at 14:28

    It doesnt work. I have a Child Theme and i put the code in functions.php. But you can still see the Name "Katagorie-Archive: Archiv". Pleas help!

  4. Hoa Nguyen Hoa Nguyen on October 17, 2017 at 20:31

    Hi,

    Please HELP! I put the code in and my site is gone after refreshing. Here is the error message:

    This page isn’t working

    suamelatotnhat.com is currently unable to handle this request.
    HTTP ERROR 500

    What should I do now?

  5. Anh Tran Anh Tran on October 18, 2017 at 06:33

    Hi Hoa,

    Can you take a screenshot of your functions.php file? I guess you put it before the opening PHP tag. If so, please try to copy and paste the code below the

  6. Anh Tran Anh Tran on October 18, 2017 at 06:34

    Hi Frodo, what parent theme are you using?

  7. Hoa Nguyen Hoa Nguyen on October 18, 2017 at 14:08

    Hi Anh,

    My site has totally crashed now. I can't go back into it any more. All I have now is the error message:

    This page isn’t working

    suamelatotnhat.com is currently unable to handle this request.
    HTTP ERROR 500

    I put the code at the very end of my functions.php file.

    Is there anything I can to get my site back?

    Thanks,

  8. leanderprt leanderprt on October 25, 2017 at 18:56

    Thank you so much

  9. Lauren Lauren on November 21, 2017 at 07:43

    It didn't work for me either, I am using Dyad 2 theme.

  10. josh josh on December 21, 2017 at 12:54

    my theme does not have a function.php file in the WP admin view. It does have a space for custom CSS codes. can you help?

    • Anh Tran Anh Tran on December 22, 2017 at 11:03

      You probably is using a child theme. In this case, you still can create a file functions.php in your child theme and add the code in the article.



  11. derickcampos derickcampos on January 9, 2018 at 01:20

    Thanks a lot!

    This worked perfectly!

  12. Amy Johnston Amy Johnston on January 13, 2018 at 14:47

    Doesn't seem to work on mine. i am using Inverto theme. Any help would be appreciated!

  13. Eddie Eddie on January 18, 2018 at 08:34

    Hi, Tran, am using evolve theme and it did not work even after inserting the code at the end of the function.php.

    • Anh Tran Anh Tran on January 19, 2018 at 04:51

      Hi Eddie, probably the theme outputs the title in a different way. You need some coder to help you resolve this.



  14. Aryenne Aryenne on February 15, 2018 at 07:11

    Worked like magic. Thank you for such a simple solution! As a novice struggling to understand JavaScript, the only thing I'd like to see is some explanation of how this magic works.

  15. heroaccessoires heroaccessoires on March 17, 2018 at 13:02

    Thanks a lot ! it worked perfectly for me but I have also a shop in my website using woocommerce, the word "Category" is removed for categories in the blog but it still in the shop categories. Can any one tell me how to remove it?

  16. Naveen Chary Naveen Chary on March 18, 2018 at 11:02

    great, thanks a lot , it saved my time

  17. phoebestraw phoebestraw on April 3, 2018 at 15:27

    Thank you it works !! 🙂

  18. as@asq.pl as@asq.pl on April 16, 2018 at 08:07

    How to remove word "category:" in breadcrumb?

  19. Francesco Fazzari Francesco Fazzari on April 17, 2018 at 08:33

    I've the same problem. Can someone halp me?

  20. shaikh asim shaikh asim on August 9, 2018 at 13:07

    thanx alot bro it really help me

  21. JJ Spelman JJ Spelman on August 17, 2018 at 17:56

    Works perfectly, thank you!

  22. duc904 duc904 on December 9, 2018 at 12:51

    Thanks very much for the hit! works perfect!

  23. L.A. Randle L.A. Randle on July 13, 2024 at 22:37

    Thank yo so much! It worked!

Leave a Comment






Scroll To Top