Remove “Private” & “Protected”: How To Do This in WordPress

StevenWordPress

Whenever you publish a post and set it to being Private or Password-Protected, WordPress will automatically prepend “Private:” or “Protected:” to your WordPress blog post title.

However, if you want to keep your post titles clean, all you need to do is paste the following piece of code in your functions.php file:

function the_title_trim($title) {
  $title = attribute_escape($title);
  $findthese = array(
    '#Protected:#',
    '#Private:#'
  );
  $replacewith = array(
    '', // What to replace "Protected:" with
    '' // What to replace "Private:" with
  );
  $title = preg_replace($findthese, $replacewith, $title);
  return $title;
}
add_filter('the_title', 'the_title_trim');

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

Once the code is pasted in fuctions.php, simply save the file and it will be activated automatically.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

No thanks, I have enough money