Remove/change “Protected:” prefix for password protected post

As you already know about the Password protected setting for your post or page. When your post or page is protected it will show “Protected” prefix before its title. If you want to change or remove that prefix just follow the below steps :-

  • First go with WordPress Dashboard >Appearance >Editor section.
  • In editor section there is a functions.php file of your theme. In this file add the following code at the end of the file :


    [code type=html]
    **
    * Removes or edits the ‘Protected:’ part from posts titles
    */

    add_filter( ‘protected_title_format’, ‘remove_protected_text’ );
    function remove_protected_text() {
    return __(‘Protected: %s’);
    }
    [/code]
    12-22-2016-6-14-14-am
    By this you can change or remove the “Protected:” text if needed. Save your changes and see that changes on your page or post.

  • Once you checked your prefix is changed now you can remove it completely again go to your editor and add this code :


    [code type=html]
    /**
    * Removes or edits the ‘Protected:’ part from posts titles
    */

    add_filter( ‘protected_title_format’, ‘remove_protected_text’ );
    function remove_protected_text() {
    return __(‘%s’);
    }
    [/code]
    password protected
    Now Save changes and check the page once again.The prefix was removed and post’s title does not differ from the others now.

  • Hope this will help you. For more information you can contact our support team at support forum.