Remove Private, Protected prefix from WordPress post title

If you show private or protected WordPress posts in View, you will see these prefixes in post title. They are injected by WordPress core.
To remove these prefixes, please add this code to file functions.php of your WordPress theme:

// Remove Private, Protected prefix from post Title
add_filter( 'private_title_format', 'cv_disable_title_prefix', 99, 2 );
add_filter( 'protected_title_format', 'cv_disable_title_prefix', 99,2  );
function cv_disable_title_prefix( $format, $post ) {
	$format = '%s';
	return $format;
}

Thank you,

Scroll to Top