Remove Protected Post Title Prefix

By default, WordPress will prefix protected post’s title with Protected. This is good when the password hasn’t been supplied. Unfortunately, it doesn’t remove this prefix when the correct password has been supplied which is not good IMO. Here’s a snippet to ‘fix’ this behavior:

function kc_protected_title_format( $format ) {
	if ( !post_password_required() )
		$format = '%s';

	return $format;
add_filter( 'protected_title_format', 'kc_protected_title_format' );
Remove Protected Post Title Prefix

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.