Remove ‘Protected’ from Page Title in WordPress

May 19, 2021 | How To Guides, Wordpress

As you probably already know, if you set your WordPress page or post to “Password Protected”, then the word “Protected” will show before the default page title on the front of your website.

A lot of people want to get rid of this – fortunately it’s nice and easy!! Just add the following code to the end of your functions.php file:

add_filter( 'protected_title_format', 'joy_remove_protected_title' );
function joy_remove_protected_title() {
return __('%s');
}

Or perhaps you’d like a different word there instead? The same function will do that, just put your chosen text before (or after) the %s inside the quotation marks:

add_filter( 'protected_title_format', 'joy_change_protected_title' );
function joy_change_protected_title() {
return __('Secure: %s');
}

Save your changes, and voila! All done 🙂

Browse More Hints & Tips

Autoplay Videos in Divi

Autoplay Videos in Divi

Setting videos to autoplay has bugged website developers for years, and in Divi there are no default options to Autoplay your videos. Some people suggest setting your video as a background to allow autoplay, but this comes with its own issues (like setting the...

How to Choose the Best Website Address (Domain/URL)

How to Choose the Best Website Address (Domain/URL)

This article was first written 24 Sept 2011, and has been updated August 2020. What is a website address? Your website address, or domain name, is used to identify and access your website. It looks something like www.yourwebsite.com. No two website addresses...

0 Comments

Submit a Comment

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