Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Customize the WordPress Archive Title
* Remove archive title prefixes.
* @param string $title The archive title from get_the_archive_title();
* @return string The cleaned title.
function grd_custom_archive_title( $title ) {
// Remove any HTML, words, digits, and spaces before the title.
return preg_replace( '#^[\w\d\s]+:\s*#', '', strip_tags( $title ) );
add_filter( 'get_the_archive_title', 'grd_custom_archive_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.