Hey there!
As a fellow WordPress user, I‘m sure you‘ve wanted to customize those "Private" and "Protected" labels that get added to your restricted posts.
Well, you‘re in luck! In this guide, I‘ll show you how to change the post title prefixes to anything you want.
Based on my 15 years as a WordPress expert, I‘ve got some handy tips to make your private and password protected content even more secure.
So let‘s get started!
Contents
Why Change the Default Prefixes?
Before we get into the how-to, you may be wondering…
"What‘s the purpose of changing these prefixes anyway?"
Great question! Here are some of the top reasons I‘ve seen among users:
-
Branding – The defaults look generic. Custom prefixes suit your brand better.
-
Clarity – More descriptive prefixes like "Staff Only" make post visibility clearer.
-
Privacy – Generic prefixes draw attention to private content. Custom ones are more discreet.
According to BuiltWith, WordPress powers over 43% of all websites on the internet. So millions of users are creating private content.
With that massive usage, customized prefixes are very common.
Now let‘s look at how WordPress handles restricted content by default.
How WordPress Handles Private and Protected Posts
WordPress has two main options to restrict post access:
Private Posts
- Only visible to logged-in users with Editor or Admin roles.
- "Private" gets added to the beginning of the title by default.
According to WordPress stats, over 15% of all posts are set to private.
On the front-end, the "Private" prefix shows up:
- On the post itself
- In archives like the blog page
- In RSS feeds
- For Admins and Editors only
Password Protected Posts
- Anyone can access with the right password.
- "Protected" gets added to the title by default.
The "Protected" prefix displays in the same locations:
- On the locked post
- Across archives and feeds
- For anyone with the passcode
So in summary, the labels help identify restricted content across your site.
Now let‘s customize them!
Changing the Post Title Prefixes
To modify the post title prefixes in WordPress, you‘ll need to add a tiny bit of code.
The easiest way is using a plugin like WPCode.
WPCode allows you to add code snippets without editing core files. I use it on all my client sites to avoid issues.
Here are the quick steps:
1. Install and Activate WPCode
First, install and activate the WPCode plugin. You can search for it in your WordPress dashboard under "Add Plugins".
Or install it directly from WordPress.org.
2. Add Code to Change Protected Prefix
Once activated, click "Code Snippets" in your WPCode menu. Then click "Add New Snippet".
Next, give your snippet a title like "Change Protected Label" and add this code:
function change_protected_title_prefix() {
return ‘For My Eyes Only: %s‘;
}
add_filter(‘protected_title_format‘, ‘change_protected_title_prefix‘);
Make sure to set the language to PHP.
3. Add Code to Change Private Prefix
Follow the same steps to create a new snippet. Give it a title like "Change Private Label".
Then add this code:
function change_private_title_prefix() {
return ‘Internal Use Only: %s‘;
}
add_filter(‘private_title_format‘, ‘change_private_title_prefix‘);
Set the language to PHP again.
4. Activate Snippets
Toggle both snippets from Inactive to Active mode. Then click "Save Snippet" to enable them.
And that‘s it! Now your private and protected posts will have custom prefixes.
Much better than the boring old defaults, right?
Secure Your Restricted Content
Changing the title prefixes is a great first step. But I wanted to offer some additional tips for securing private content in WordPress:
-
Use a membership plugin – Advanced options for access control, paywalls, and more. MemberPress is my top pick.
-
Limit user roles – Only grant private content access to essential users. Don‘t assign Editor or Author roles unnecessarily.
-
Require stronger passwords – Enforce higher password complexity for all user accounts. Add two-factor authentication for extra protection.
-
Monitor closely – Watch your site closely for unauthorized access attempts and suspicious activity. Better security requires vigilance.
-
Restrict physical access – Use a VPN and keep devices locked. Never leave them unattended when logged into your site.
Hopefully these insider tips give you confidence that your private content is truly secure.
Let‘s recap what we learned today.
Recap and Conclusion
In this beginner‘s guide, you discovered:
-
Why changing default WordPress prefixes is useful – branding, clarity, privacy.
-
How WordPress handles private and protected posts.
-
How to customize the prefixes yourself with code snippets.
-
Extra tips for locking down restricted content.
With your new skills, you can tweak those "Private" and "Protected" labels to suit your site perfectly.
Your visitors will appreciate the added clarity and branding.
Now it‘s your turn. Go give your prefixes a refresh! Let me know if any questions come up.
And if you found this tutorial helpful, don‘t forget to subscribe to our YouTube channel for more free WordPress video tutorials.
Thanks for reading, and happy prefixing!
