Clean archive titles in WordPress, remove (Category:, Archive: etc.)

//clean archive titles
add_filter( 'get_the_archive_title', function ($title) {    
	if(is_archive() && 'post' == get_post_type()){
		$title = ltrim(stristr($title, ':'), ':');
    return $title;    
Need a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us