Remove “archive” etc from title on archive pages

Add this to your functions.php


add_filter('get_the_archive_title', function ($title) {
    return preg_replace('/^\w+: /', '', $title);
});

The code removes whenever there is a word and : in archive title… not likely to have that in a normal category title so I like this solution!

Add your comment