How to remove "Category:" in title from category pages
Last Updated: August 8, 2020 in Guides
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):
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.
Super, it did the job!
Great, thanks, it worked perfectly.
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!
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?
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
Hi Frodo, what parent theme are you using?
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,
Thank you so much
It didn't work for me either, I am using Dyad 2 theme.
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?
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.
Thanks a lot!
This worked perfectly!
Doesn't seem to work on mine. i am using Inverto theme. Any help would be appreciated!
Hi, Tran, am using evolve theme and it did not work even after inserting the code at the end of the function.php.
Hi Eddie, probably the theme outputs the title in a different way. You need some coder to help you resolve this.
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.
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?
great, thanks a lot , it saved my time
Thank you it works !! 🙂
How to remove word "category:" in breadcrumb?
I've the same problem. Can someone halp me?
thanx alot bro it really help me
Works perfectly, thank you!
Thanks very much for the hit! works perfect!
Thank yo so much! It worked!