WordPress.org

Ready to get started?Download WordPress

Forums

removing the word Protected (9 posts)

  1. TLCJohn
    Member
    Posted 2 years ago #

    Hi there Guys.

    Please can I ask for some help. I am building a site at the moment and there are some pages that are protected. The Client has requested that I remover the word "Protected" for these pages but I cannot find out how to do it. Can anyone help please.

    Kind regards

    John

  2. sjovic
    Member
    Posted 2 years ago #

    I have the same problem.
    Old posts (3 yrs before cant help!)

    Regards,
    Slobodan

  3. Mark / t31os
    Moderator
    Posted 2 years ago #

    Add this to your theme's functions.php file, eg. wp-content/themes/YOURTHEME/functions.php

    add_filter( 'protected_title_format', 'remove_protected_text' );
    function remove_protected_text() {
    	return __('%s');
    }
  4. TLCJohn
    Member
    Posted 2 years ago #

    Hi there Mark,

    Thank you for the code... Where about's in the functions.php file would I place the code you have so kindly written?

    Kind regards

    John

  5. Mark / t31os
    Moderator
    Posted 2 years ago #

    After the <?php (opening php tag), on a new line at the top of the file would probably be the easiest place(less room for error).

    :)

  6. TLCJohn
    Member
    Posted 2 years ago #

    Hi there Mark.

    Thank you for your help, You are a smashing guy for helping me out. I am trying to learn WordPress quickly and your help is much appreciated.

    Kind regards.

    John

  7. TLCJohn
    Member
    Posted 2 years ago #

    Hi Mark (again)

    Footnote. I have just added the code into the php file and it works beautifully. Thank you, thank you, thank you.

    All the very best for now.

    Kind regards

    John

  8. Mark / t31os
    Moderator
    Posted 2 years ago #

    You're welcome John. :)

  9. sjovic
    Member
    Posted 2 years ago #

    Mark, Thank you for your help. It helped me a lot!
    Rgeards,
    Sjovic.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.