Categories

Featured templates

WordPress. How to remove/change “Protected:” prefix for password protected posts

Erica Saunders June 17, 2016
Rating: 5.0/5. From 2 votes.
Please wait...

Hello! This tutorial is going to show you how to edit or remove the ‘Protected’ prefix from password protected posts in WordPress.

If your post is protected with a password, the specific prefix will be displayed before its title in the blog listing:

64.Wordpress.How_to_remove_protected_prefix_1
  1. In order to edit it you need to open your FTP or File manager tool at the hosting cPanel, then go to wp-content/themes/themeXXXX folder (here XXXX stands for your theme number) and open functions.php file for editing. You can also reach this file at site Dashboard, at the Appearance -> Editor section.

  2. Add the following code to the end of file:

    			/**
    			* Removes or edits the 'Protected:' part from posts titles
    			*/
    
    			add_filter( 'protected_title_format', 'remove_protected_text' );
    			function remove_protected_text() {
    			return __('Protected: %s');
    			}
    		

    Here you can also change or remove the “Protected:” text if needed.

  3. Edit the text and save changes. Then refresh your blog page to see the modifications applied.

    64.Wordpress.How_to_remove_protected_prefix_2
  4. As you can see, prefix was edited successfully. Let’s remove it completely. In order to do this, delete the text you don’t need to appear (but keep the ‘%s’ that stands for title). As a result, your code will appear this way:

    			/**
    			* Removes or edits the 'Protected:' part from posts titles
    			*/
    
    			add_filter( 'protected_title_format', 'remove_protected_text' );
    			function remove_protected_text() {
    			return __('%s');
    			}
    		
  5. Save changes and check the page once again.The prefix was removed and post’s title does not differ from the others now.

    64.Wordpress.How_to_remove_protected_prefix_3

Now you know how to edit or remove the ‘Protected’ prefix from post’s titles.

Feel free to check the detailed video tutorial below:

WordPress. How to remove/change “Protected:” prefix for password protected posts
Website Templates for Wordpress
This entry was posted in WordPress Tutorials and tagged password, post title, protection, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket