Had a search around and can't seem to find any options to do this, found quite a few posts on how to personalise the login page but nothing about removing the Protected text that is automatically added before the page title, anyone able to shed some light?
EDIT:
Found the answer here in the end http://wordpress.org/support/topic/how-to-remove-private-from-private-pages, code as follows
function the_title_trim($title)
{
$pattern[0] = '/Protected:/';
$pattern[1] = '/Private:/';
$replacement[0] = ''; // Enter some text to put in place of Protected:
$replacement[1] = ''; // Enter some text to put in place of Private:
return preg_replace($pattern, $replacement, $title);
}
add_filter('the_title', 'the_title_trim');
There are dedicated wordpress filters ('private_title_format' and 'protected_title_format') applied to the post title when the post visibility is set to private or protected and you should use that in your functions.php instead of replacing all post-titles:
add_filter( 'private_title_format', 'myprefix_private_title_format' );
add_filter( 'protected_title_format', 'myprefix_private_title_format' );
function myprefix_private_title_format( $format ) {
return '%s';
}
Found the answer here in the end http://wordpress.org/support/topic/how-to-remove-private-from-private-pages, code as follows
function the_title_trim($title)
{
$pattern[0] = '/Protected:/';
$pattern[1] = '/Private:/';
$replacement[0] = ''; // Enter some text to put in place of Protected:
$replacement[1] = ''; // Enter some text to put in place of Private:
return preg_replace($pattern, $replacement, $title);
}
add_filter('the_title', 'the_title_trim');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With