WordPress provides all the basic functionality for blogging and rapid website development. The majority of bloggers use WordPress for their blogs and affiliate websites because WordPress is SEO friendly.
Also, WordPress has archives feature, which is quite helpful for bloggers to generate categories and author archives.
By default, category archives title published with prefix “Category: “, however it may change according to themes.
Read More: Add Custom Link in WP-Admin Sidebar
Category prefix in title varies according to theme. But, we can remove category prefix from the title of the archive page. Even more, we can also remove other archive prefixes using the below code.
Just add the below code at the end of the functions.php file.
Code
//custom archive header
add_filter( 'get_the_archive_title', 'errorsea_archive_title' );
function errorsea_archive_title( $title ) {
if ( is_category() ) {
// Remove prefix in category archive page
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
// Remove prefix in tag archive page
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
// Remove prefix in author archive page
$title = get_the_author();
}
return $title;
}
Explanation
In the above code, we have registered a new function to filter the default titles of category, tag, and author archives.
I hope now you can remove the category: prefix from the category archives title. You can also add another prefix or postfix to the title according to your SEO requirement.
Happy Blogging 🙂
There is a reason big-name companies like CNN use WordPress. WordPress is a popular content…
In this tutorial, I'm going to show you how to install MySQL on your computer.…
Download Turbo C++ for windows 10 in just 7 Mb and run your first C++…
We can redirect any webpage to any other or redirect the whole domain or website…
There are lots of methods to redirect pages, like refresh-redirect from META tag, redirect from…
Include files in PHP are used in appending various global or config files. We can…