Have you ever defined a specific blog post or page as, private or protected in WordPress? If you have, did you know that WordPress by default, appends “Private” or “Protected” to those post and page titles? If you prefer not to display this in your titles, there is a very easy hack to get rid of them.
To apply this WordPress hack, you simply paste the following code into your functions.php file. After you have pasted code into the proper file, save the file to apply the hack to your posts and pages. That’s it, your done!
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’);
Credit for this hack, goes to Chris Coyier.
Hope this blog post was helpful to you, “Removing the “private” and “protected” from your post title” Be sure to share this post with your friends on Twitter. Furthermore, I appreciate your time that you have spent here!
Spunky Jones.

Comments on this entry are closed.