How to remove "Category:", "Tag:", "Author:" from the_archive_title

0 votes
I do not want to show "Category:", "Tag:", "Author:" in my archive page, how to remove please help
asked Nov 27, 2016 in Wordpress by Mukesh Sharma
edited Apr 26, 2018 by suresh

1 Answer

0 votes
Best answer
Add this block of code to your functions.php file.

add_filter( 'get_the_archive_title', function ($title) {
    if ( is_category() ) {
            $title = single_cat_title( '', false );
        } elseif ( is_tag() ) {
            $title = single_tag_title( '', false );
        } elseif ( is_author() ) {
            $title = '<span class="vcard">' . get_the_author() . '</span>' ;
        }
    return $title;
});
answered Nov 27, 2016 by suresh (1,210 points)

Related questions

0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
asked Dec 5, 2018 in SEO by govind
0 votes
1 answer
asked Apr 16, 2018 in SEO by anonymous
0 votes
1 answer
asked Apr 16, 2018 in SEO by anonymous
Welcome to SEO Questions Answer Forum, where you can ask questions and receive answers from expert members of the community.
37 questions
31 answers
1 comment
1 user