Change Protected Posts Prefix

If you’ve marked a post as “Protected” it is automatically prefixed with “Protected: ”

You may not like that. Here’s how you can change it:

add_filter('protected_title_format', 'change_protected_title_format');
function change_protected_title_format() {
	return 'Members Only: %s';
}

*If this seems oddly familiar, check out yesterday’s post.

2 thoughts on “Change Protected Posts Prefix”

    1. Daryl L

      If you’ve done a copy and paste, it’s possible that some of the whitespace in the snippet is being rendered incorrectly. Highlight the space at the beginning of line 3 and remove or replace it.

Leave a Reply

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