Featured image for Remove “Archive:” prefix from archive titles in WordPress

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

Who’s the dev?

Code Snippet by
@mike  •  Mike C.


I’ve been a web designer/developer for 20+ years. "Coffee in, code out." I love tinkering with WordPress, Photoshop, Blender, Bootstrap, and AI. I split my time between France and the Netherlands. When I’m off the clock, I enjoy creating assets and mods for video games like Ark, Cities: Skylines, and The Sims.

alox.co


Join the conversation


You must be logged in to comment.
Login or register for a free account now!
Alox & Co

Login



Not yet a member?

Create your free account today and start a new adventure!

Register