As a rule, posts, protected by password, have a prefix, as it’s shown on the screen below. From this tutorial, you’ll learn how to change post prefix. Read ahead!
What Is Post Password Protection?
Passwords allow you to restrict access to the entire site or only to its certain parts. Sometimes on a WordPress website, it’s necessary to show some posts or pages only to a limited number of people. For example, it can be some draft article for an editor, etc. To do this, you can set a password and share it with those you prefer.
As well, pay attention to a few things you should know about post prefix protection:
- The maximum password length is 20 characters, the minimum is 1 character.
- After you enter a password for a post or page, it will be remembered, and you won’t have to type it again.
- Also note, in cookies only one password for the last viewed post can be stored.
- If your password has been changed in the admin panel, then it will have to be re-entered.
- You can also set a password through Properties (quick editing of entries).
Changing Post Prefix
First, navigate to your hosting server cPanel file manager and open wp-content/themes/theme_name folder. Here locate functions.php file. You can click on Edit button to open it with code editor.
Add the following code to the end of the file.
Note, that you can remove Protected text completely, or replace it with your own one. To delete the text remove it completely, leaving only “%s” symbol.
Save the changes. As a result, you’ll see your custom text instead of Protected default prefix.