Blog of a web developer from Japan

WordPress: How To Customise Archive Title

2018-03-29 | Tips | WordPress

Sometimes you'd want to remove the "Category: " or "Archive:" etc. that WordPress automatically adds in front of the archive page title. In order to do that, add below code to your functions.php.

 * Remove "Category:" or "Archive:" etc. from archive title.
function custom_archive_title($title) {
  return preg_replace('/.*?: /', '', $title);
add_filter( 'get_the_archive_title', 'custom_archive_title' );