Remove “Archive:” prefix from archive titles in WordPress
05/10/2025 · Code Snippets
This snippet cleans archive page titles by removing automatic prefixes such as “Category:”, “Tag:”, “Author:”, and “Archives:”.
You get short, elegant headings that match your design and improve readability without touching templates.
It hooks into get_the_archive_title and returns context-aware titles. Categories and tags show only the term name, author archives show the display name, and date archives output a concise date label.
/** Clean WordPress archive titles **/
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_tax()) {
$title = single_term_title('', false);
} elseif (is_author()) {
$title = get_the_author();
} elseif (is_year()) {
$title = get_the_date('Y');
} elseif (is_month()) {
$title = get_the_date('F Y');
} elseif (is_day()) {
$title = get_the_date('j F Y');
} elseif (is_post_type_archive()) {
$title = post_type_archive_title('', false);
}
return $title;
}, 10, 1);
🔧 Where to insert this snippet?
Add it to your theme’s functions.php or a site-specific plugin. For multisite, use the network-active variant.
💡 Why use this?
Cleaner UI and consistent headings across archives.
- Removes redundant prefixes
- Improves readability
- Keeps SEO titles focused on keywords
- No template overrides needed