[Support request] Private Page Heading

Home Forums Support [Support request] Private Page Heading

Home Forums Support Private Page Heading

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1680089
    Lee

    Hey guys,

    I’ve created a private page on my website all well and good. However, the title shows up with the word “Private” along with the title that I’ve chosen. But I’d like to remove the “Private”.

    I’ve done a little research and I’ve found this:

    First go with WordPress Dashboard >Appearance >Editor section.
    In editor section there is a functions.php file of your theme. In this file add the following code at the end of the file :

    /**
    * Removes or edits the ‘Protected:’ part from posts titles
    */
    add_filter( ‘protected_title_format’, ‘remove_protected_text’ );
    function remove_protected_text() {
    return __(‘Protected: %s’);
    }

    However, I don’t want to be messing with the theme code without knowing if this advice is sound.

    Does this look right to you, or is there an easier way of removing the “Private” in the title?

    Many thanks in advance,

    #1680157
    David
    Staff
    Customer Support

    Hi there,

    never make any edits to the Theme files as those changes will be lost when the theme update.
    This article explains how to add PHP snippets like that to your site:

    https://docs.generatepress.com/article/adding-php/

    TLDR: If you’re using a child theme need you can add it to the child theme functions.php. If you have no child theme then install the Code Snippets plugin and create a new snippet to add the code to.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.