July 08, 2020
When content is set to Password Protected, the word “Protected” appears in front of the title in the content area within loops, and on single Post and Pages.
You can edit this default text using this function (place in functions.php):
/* Removes or edits the 'Protected:' part from posts titles */
add_filter( 'protected_title_format', 'remove_protected_text' );
function remove_protected_text() {
return __('Protected: %s'); // where the magic happens
}
You can update the text to something else:
add_filter( 'protected_title_format', 'remove_protected_text' );
function remove_protected_text() {
return __('Early Access: %s'); // where the magic happens
}
Or remove the text completely:
add_filter( 'protected_title_format', 'remove_protected_text' );
function remove_protected_text() {
return __('%s'); // where the magic happens
}