Grow your CSS skills. Land your dream job.

Last updated on:

Remove Private/Protected from Post Titles

For the functions.php file in your theme:

function the_title_trim($title) {

	$title = attribute_escape($title);

	$findthese = array(

	$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');


  1. Or you do it like that:

    function title_format($content) {
    return '%s';
    add_filter('private_title_format', 'title_format');
    add_filter('protected_title_format', 'title_format');

  2. Victor Meyer
    Permalink to comment#

    Thanks man!

  3. Thank you so much! This was bothering me on a client site I am developing.

  4. Permalink to comment#

    That’ perfect. Very clean and simple and, most importantly, worked like a charm!

  5. Worked perfectly, thanks!

  6. Permalink to comment#

    WordPress 3.3: incorrect.

    There is no such function in functions.php.

    Instead, go to post-template.php and in the function called get_the_title() change this line:

    $protected_title_format = apply_filters('protected_title_format', __('Protected: %s'));

  7. Works great thanks!
    [Wordpress 3.3.2]

  8. Permalink to comment#

    You can also use the WordPress Helpers plugin.

    • Errol
      Permalink to comment#

      How do you use the WordPress Helpers plugin to accomplish this? Can you give more detail?

    • Chantilly
      Permalink to comment#

      I installed the set of plugins for the Helper and was really glad to have done so. It solved a few problems, not all of them but- some of them. You have to first install Piklist, then follow that with Helpers. Piklist is in the plugins menu and the Helpers is under Available Tools. You only have to use Helpers to accomplish the edits and such that are available. Easy, and a video to help explain it (sell it- though it is free).


    This didn’t work with Buddypress on my page.

  10. hey there and thank you for your info – I have
    certainly picked up anything new from right here.
    I did however expertise some technical issues using this website, as I experienced to reload the website lots of times previous
    to I could get it to load correctly. I had been wondering if your web hosting is OK?
    Not that I am complaining, but slow loading instances times will
    very frequently affect your placement in google and could damage your quality
    score if ads and marketing with Adwords. Well I am adding this RSS to my e-mail and can look out for a lot more of your respective exciting content.
    Make sure you update this again soon.

    Feel free to surf to my web blog; hunger suppressant foods [](http:
    // “”)

  11. Permalink to comment#

    I just wrote a plugin for this too at

  12. Permalink to comment#

    Copy, paste, problem fixed. The perfect tutorial! :)

  13. ItKnol
    Permalink to comment#

    using a filter is always the best solution.
    Any seasoned developer would disagree on using a regular expression on such a simple thing.

  14. Sebk
    Permalink to comment#

    the solution proposed by Konstantin is working for me! Thank’s!

Leave a Comment

Posting Code

  • Use Markdown, and it will escape the code for you, like `<div class="cool">`.
  • Use triple-backticks for blocks of code.
      <h1>multi-line block of code</h1>
      <span>be cool yo.</span>
  • Otherwise, escape your code, like <code>&lt;div class="cool"&gt;</code>. Markdown is just easier though.

Current ye@r *

*May or may not contain any actual "CSS" or "Tricks".