How to Change Private and Protected Posts Prefix in WordPress


Do you find yourself having a lot of private or protected posts? If you do, then you probably notice that WordPress puts either Private: or Protected: in front of the title. Most users could careless about what goes in front, if they are the only one seeing the site. But, if you have a multi-author blog, or a personal blog, you can make things interesting by changing the default prefix.

For example: if you have a personal blog which your family reads, then you can have all protected posts title say: “Family Only: Post Title Goes Here”.

In this article, we will show you how easy it is to change the private and protected posts prefix in WordPress.

Change Protected Posts Prefix

Simply paste the following code in your theme’s functions.php file

  function change_protected_title_prefix() {      return 'Family Only: %s';  }  add_filter('protected_title_format', 'change_protected_title_prefix');  

Change Private Post Prefix

Paste the following code in your theme’s functions.php file:

  function change_private_title_prefix() {      return 'Editors Only: %s';  }  add_filter('private_title_format', 'change_private_title_prefix');  

You don’t have to use the examples we suggested. You can get creative with this. This is just another way you can spice up your blog.

This article is presented to you by the leader in fast postcard printing, Next Day Flyers.

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.