Skip to content Skip to menu

Dzikri Aziz

The D is silent — kind of.

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' );

Posted on in Tips & Tutorials.