How To Change Private And Protected Posts Prefix In WordPress
How To Change Private And Protected Posts Prefix In WordPress

Do you want to modify the prefix for private and protected articles in WordPress?

When you make a post private or password protected, WordPress automatically adds the ‘Private’ or ‘Protected’ prefix to the title.

In this tutorial, we’ll teach you how to modify the Private or Protected post prefix in WordPress to whatever you like.

What are WordPress Private or Protected Posts?

WordPress includes some basic options for creating material and keeping it hidden from public access. 

These choices are available on the editor screen in the ‘Status & Visibility’ box. WordPress post visibility settings The ‘Private’ option restricts access to the material to logged-in users only.

To peruse private material, clients should have essentially an Editor or Administrator client job. 

The ‘Password Protected’ choice lets anyone with a password see the material, regardless of whether they aren’t a client on your WordPress site.

At the point when you publish a private post, WordPress will add ‘Private’ as a prefix to the post title.

You can watch the video tutorial below for this article:

It will be noticeable to signed-in overseer or editor users on the post or page being referred to, as well as any document pages, for example, the landing page or fundamental blog page.

Similarly, WordPress prefixes password-protected posts and pages with ‘Protected.’

WordPress’s protected post prefix

The purpose of using these labels in the post names is to differentiate them from other non-private and public entries on your website.

Some users may now choose to modify these prefixes to something more relevant or useful to their target audiences.

  • Go on your WordPress Admin Dashboard.
  • Hover directly to Appearances.
  • Click at the Theme Editor.
  • Tap on Theme Functions on the top right hand side. 
  • Scroll right all the way down to the cease of the code.
  • Now, you have to add a small piece of code.
How To Change Private And Protected Posts Prefix In WordPress

NOTE: Prior to making any code-related transforms, it is proposed to have a backup of your site JUST IN CASE anything turns out badly, then you can basically reestablish it subsequently


Protected Posts Prefix

function change_protected_title_prefix() {
    return 'Family Only: %s';
add_filter('protected_title_format', 'change_protected_title_prefix');

Change the prefix ‘Family Only’ to whatever you choose for your password-protected postings.

On your website, you may now preview a password-protected post.

Private Post Prefix

function change_private_title_prefix() {
    return 'Editors Only: %s';
add_filter('private_title_format', 'change_private_title_prefix'); 
How To Change Private And Protected Posts Prefix In WordPress

Feel free to change ‘Editors Only’ to whatever you like for your private posts.

After that, you may see it in action by visiting a private post or page. This is how it appeared on our test site.

As long as you followed all the instructions correctly, you’ll be able to change private and protected posts prefixes in WordPress.

In case you have more queries, and require more help, feel absolutely free to check out our website or contact Digital Suncity. 

Also Read: How To Fix Image Upload Issue In WordPress 


Submit a Comment

Your email address will not be published. Required fields are marked *

Need Professional Help?

We can help you with website fixes and ongoing maintenance.