WordPress adds ‘Protected’ / ‘Private’ in front of the title of a protected/private page. This is how to remove or change it by changing the text in the highlighted lines.
/** START Removes or edits the 'Protected:' part from posts titles */
add_filter( 'protected_title_format', 'remove_protected_text' );
function remove_protected_text() {
return __('Protected: %s');
}
add_filter( 'private_title_format', 'remove_private_text' );
function remove_private_text() {
return __('Private: %s');
}
/** END Removes or edits the 'Protected:' part from posts titles */
Code language: PHP (php)