Customizr includes some useful filters if you need to customize your category archives titles.
Changing the default prefix : “Category Archives :”
add_filter('tc_category_archive_title' , 'my_cat_title'); function my_cat_title($title) { return 'My archives title for : '; }
Changing the heading of a specific category’s archives page
Just replace “my_cat_name” with the name of the desired category.
add_filter('tc_category_archive_header_content' , 'my_cat_heading'); function my_cat_heading($content) { global $wp_query; if ( 'my_cat_name' != $wp_query -> query_vars['category_name'] ) return $content; return '<h1 class="my_custom_class">My custom title</h1>'; }
Where to copy/paste this code? The following code has to be pasted in your functions.php file. I strongly recommend that you create a child theme. Download a start-up child theme here.
Everything you need to know about child theme with Customizr here.
20 thoughts on “Changing the title of the categories archive pages”
Hi Nicolas,
your (first) solution indeed works fine for normal post archives. But there is (at least seems to be) no chance to get rid of the “Archive:” prefix when you´re using custom posts getting queried in its own archive-template.
Situation as follows:
1.) I got a custom post type named “portfolio”
2.) Set up a heavily modified “archive-portfolio.php” to query custom post types with
$args = array(
‘posts_per_page’ => -1,
‘post_type’ => ‘portfolio’
);
query_posts($args);
3.) Inserting the first code example on top doesn´t really help – “Archives:” still showing up :/
I´m using the latest (free) Customizr Version. I can also post a gist or whatever of the full code of the custom archive-template if that helps..
Thanks in advance for any help!
Can’t get this to work. It shows “category archives: title”. I want to get rid of the Category Archives part. I’ve downloaded the child theme and installed it and followed all instructions above but am fairly
frustrated as none of this is working. Can you please provide me with
another method to get rid of or change “category archives”.
Hi Bill!
our developer team tries to handle technical requests for the Customizr free theme in the support forum, would you mind asking your question there ?
https://wordpress.org/support/theme/customizr
Thanks 🙂
What template are you finding this stuff in? I have tried removing code in the past and I cannot remove the archive tag from search results.
Esta foi a melhor forma de excluir a “cathegory archieves” usando o Child Theme, tema da Customizr.
Testei inúmeras formas, então coloquei o código:
(add_filter(‘tc_category_archive_title’ , ‘my_cat_title’);
function my_cat_title($title) {
return ‘My archives title for : ‘;
}
)
Depois segui o caminho TEMA–> Aparência. –> Customize -> Content : home, posts, grid, …
Rolei até ARCHIVE TITLES e apaguei a Category pages titles, a Tag pages titles, a Author pages titles e a Search results page titles.
Pronto. Obrigado Nicolas Guillaume
I want to change the default meta title with customizr theme like if my category is SEO then I don’t want to see the in title : SEO archives . what I do?
I success fully remove “Category Archives :” from header but not from meta title.
Hi Nicolas,
Thank you for your prompt reply!
Unfortunately it still doesn’t work. Probably I’m doing something wrong. This is my changed code (renamed the function and filter):
add_filter(‘tc_category_archive_title’ , ‘my_cat_title’);
function my_cat_title($title) {
return ‘XXXXXXX : ‘;
}
add_filter(‘tc_tag_archive_title’ , ‘my_cat_title1’);
function my_cat_title1($title) {
return ‘XXXXXXXX : ‘;
}
Can you give an example of the proper code?
Best regards,
Hi Nicolas,
Thank you for this great theme! Maybe you can help me? What am I doing wrong when i put this code in the functions.php? I’ll receive a blanc page. I’m using the category and tag filter at the same time.
Best regards,
add_filter(‘tc_category_archive_title’ , ‘my_cat_title’);
function my_cat_title($title) {
return ‘XXXXXXX : ‘;
}
add_filter(‘tc_tag_archive_title’ , ‘my_cat_title’);
function my_cat_title($title) {
return ‘XXXXXXXX : ‘;
}
Hi,
You are declaring the same function twice, that’s the cause of your bug.
Hope this helps!
Thnx a lot..
Hi Nicholas:
does this code work as well as for “title” metatag? I founf out google indexes archives pages as “archives + my archives category”. How do I cut off “archives” from the title?
thank you!!
Sara
This doesn’t work for my blog category page. The title remains the default.
problem solved! I didn’t realize the two snippets were for different sections of the title.
hi Nicolas,
sorry, this is little bit OT, but…how can I add a right column with widget to category archive pages? which file should I edit (through child theme, of course)?
thank you!!
Sara
This is for categories archive pages. And what about tags archive pages?
Hi Emilio,
for tags you can use the filters : “tag_archive_title” and “tc_tag_archive_header_content”?
the query_var is get_query_var(‘tag’)
Hope this helps!
Yes! Thanks a lot!!
I’m having a hard time getting it to work for the tag archives. Can you tell me the exact code to add for this? Thanks in advance!!
Hi Stacey,
You’ll want to try to replace
tc_category_archive_title
bytc_tag_archive_title
in the first snippet. This should work.Cheers