Update:
So, you’ll notice that the Title Tag of this page contains the term Private, but the H1 tag above doesn’t. This is a result of doing what I exlpain below. If you have a solution to fix this, leave it in the comments, please.
————————————————————-
I love the fact that you can make pages private in wordpress. It’s the easiest way to make a page not appear in the navigation, but still exhist on the site.
My problem has been that when you do this the title of the page changes from:
“Title Goes Here”
to:
“Private:Title Goes Here”
Now, I don’t understand the logic behind why it does this without there being an option to change it in the admin area, but I finally figured out how to fix it.
Go into the theme directory of the theme you’re using and back up the functions.php file.
Now, add this:
function remove_private_prefix($title) {
$title = str_replace(
'Private:',
'',
$title);
return $title;
}
add_filter('the_title','remove_private_prefix');
If you’re lucky like I way, “Private:” will magically go away. No more worries!
THANK YOU!!!!!!
[Reply]
You are very welcome!
[Reply]
Awesome tip Dave.
[Reply]
Hi, that works fine but then when i go to redpublish a post it gives me an error:
Warning: Cannot modify header information - headers already sent by (output started at ****/functions.php:1) in ****/wp-includes/pluggable.php on line 850
any ideas?
[Reply]
You must have the line
$title = str_replace(‘Private:’,”,$title);
all on one line.
[Reply]