Before you ask please READ THIS

Password Protected Page not working + Where do I find password form?

Hello,

having a problem I'm unable to resolve.

My "protected page" looks weird for unknown reason [1].

I haven't touched this file since installation. Upon inspecting it now, I noticed it's not looking nor working as it should.

First problem: I cannot remove the white background within Elementor to make the page transparent. Second problem: I don't see any password form to enter my data. Third problem: If I add a password for test purpose in WP admin GUI, the page loading gets stuck and Elementor asks to go into stable mode. I tried to create a brand new page, as described in the documentation. However, that also doesn't solve the problem. I'm already struggling in finding the password form in Elementor to paste in. I haven't touched the settings @ Customize -> Pages -> Password Protected Page. Those are on default settings.

What am I doing wrong?

The "protected album" as a comparison works fine btw [2].

Thanks very much for any help on this.

Best regards
Marius

[1] https://lange-grumfeld.photo/protected-page/
[2] https://lange-grumfeld.photo/album/photo-proofing-iii/

Comments

  • AirAir
    Posts: 10,970
    Hey :-)

    The password form part is not available in Elementor. This cames natively from WordPress, so it is added after your content always.

    It is explained here https://rifetheme.com/apollo13-framework/docs/customizing-the-theme/page-settings/passwords-protected-page/

    So when you will view page set as "password protected template" you will not see the form. However, when the password-protected album will load this template, there will be a password form at the end.

    As for background color - it comes from the theme. However, when the password-protected album will load this template there will be no background color(transparent).

    Sorry if this is confusing, but WordPress didn't make it easy to customize password protected part ;-)

    With kind regards.
  • edited October 2019 Posts: 89
    Hi Air,

    I read this article in the documentation in advance. But based on that, that wasn't clear to me.

    However, it's not really working as supposed for the page-version. As soon as I set a password there via WP admin panel (I've used "demo" for test purposes for the moment), the site doesn't load anymore. I get a time out. Neither I can view the page in a browser, nor edit the page anymore with Elementor. Give it a try by yourself [1].

    Before we waste our time on searching what's wrong... Is there any simple way to patch this (e.g. by overwriting my existing protected-page file with the original default file)?

    Kind regards
    Marius

    PS: Congratulations to your country winning nobel prize!

    Post edited by MLG76 on
  • AirAir
    Posts: 10,970
    Hey :-)
    MLG76 said: Before we waste our time on searching what's wrong... Is there any simple way to patch this (e.g. by overwriting my existing protected-page file with the original default file)?
    Did you edit the theme file for this? Or do you mean to revert back original template from Elementor for password protected page?

    If the later one, then If you have edited imported page, you can revert back by using Revisions tab in Elementor while editing page https://docs.elementor.com/article/104-history

    With kind regards.
  • Posts: 89
    Yes, the original theme file, which is stored in section 'Pages' as file 'Protected Page' (I haven't figured out yet how to duplicate such files, to make my own while keeping a backup). I meant restoring that file 'Protected Page' to the state of a brand new installation, so how it came from you originally.

    Thanks for the Elementor article. I have checked that revision already and reverted back to the earliest state available there. That page version (initial version?) loads normal if no password is set. However, as soon as I set any password, the page load gets stuck. So it doesn't work neither with that file revision.

  • AirAir
    Posts: 10,970
    Could you please send me temporary* access to your WordPress so I could check there what is going on? Send it here on the forum via private message(click on my nick, in top-right corner you will find option "Message"). In message please add LINK to topic it applies to.

    By sending access to WordPress I mean:
    -create a new ADMIN account with a fake e-mail
    -set some password to this account
    -send me created login and password

    *temporary - please delete this account after I am done, for your safety!
  • AirAir
    Posts: 10,970
    Hey :-)

    Thanks for the data. Everyhting works fine for me.
    MLG76 said: However, as soon as I set any password, the page load gets stuck. So it doesn't work neither with that file revision.
    Do you set this password on the Album or on the page that is named password protected?

    I am asking because the album https://lange-grumfeld.photo/album/photo-proofing-iii/ opens fine after proving "demo" password, that is set for this album.

    Generally, each album should have a different password, and this "demo" password written on the page that is named password protected is for demonstration only. You should change this text to something more generic.

    I believe there was some misunderstanding.

    If you will set a password on the page that is used for password-protected page it must fail as it will lead to infinite loop:-)

    With kind regards.
  • Posts: 89
    Hi Air,

    thanks very much for checking the configuration.

    I have set this for the page which is password protected. I haven't touched the album. Yes, the album opens fine after proving "demo" as password, which is set for album. The infinite loop is exactly what occurs.

    Well, but then I'm not understanding the sense of the password protected page. What's its mission? Maybe there is indeed a misunderstanding.
    My current understanding is, I can 1. use the protected album for proofing, setting individual passwords and/or 2. a password protected pages with also individual passwords - both totally independent from each other.
    How to set the password for the album was clear to me, as "demo" was preconfigured within the theme. Thus I tried to do the same with the page in order to see how I can make use of that within my site... and ended up in the infinite loop.

    Kind regards
    Marius

  • AirAir
    Posts: 10,970
    Hey :-)
    MLG76 said: My current understanding is, I can 1. use the protected album for proofing, setting individual passwords and/or 2. a password protected pages with also individual passwords - both totally independent from each other.
    1. You can set passwords for albums - that is clear.
    2. The page named "password protected" is a template of how a website will look when you will lock anything under password(post, page, album or work). So it is used only for design.

    When WordPress finds out that for example Album(that you try to view) is locked under password, then before displaying album it will display above mentioned page on which the user can provide a password to enter the requested album.

    In other words - the "password protected" page helps you personalize a bit this "password asking" screen.

    You can even change this page to any other premade page in Appearance → Customize → Page Settings → Password protected page template .

    I hope it is a bit clearer now.

    With kind regards.
  • Posts: 89
    Hi Air,

    okay, now I understand. Thank you very much for clarifying this. I already had the feeling yesterday it might be just a linked template, sitting there.

    I hope you don't mind, if I would like to throw in a recommendation then. In order that none might be stumbling over this (like I did) in future, I suggest to make the name of that particular page more clear (e.g. changing it from Password Protected to something like "password protected prescreen"?). Additionally a bid more beef within the respective points of the documentation would be great.

    Thanks very much once again for all your help.

  • AirAir
    Posts: 10,970
    Thanks for your suggestion!

    I am glad that this situation is solved.

    With kind regards.
  • edited November 2019 Posts: 89
    Air, pls apologize if there is one more question reg. this topic …

    I’ll have to admit, this page really drives me nuts. :-/ ;-)

    Based on your prior answer and reading the documentation at least five times carefully since then, I understood the process logic, that first you get ‚Protected Page‘ and upon successfully entering credentials ‚Protected Album‘ gets displayed. So far so good.

    Now I've tried to harmonize ‚Protected Page‘s design to integrate that smoothly into my overall site look & feel. However, settings seem to have no effect or are simply not possible. Maybe I’m simply too stupid for this page. I also notice weird behavior, which I cannot root cause to caching.

    On Friday I tried to twiddle with the header settings. What ever I selected (dark, light, normal, global), it never worked as it should. Either things where with black or white background (while menu text was not inverted) or menu was displayed correct only once I scrolled down and went back (was reproducible). I documented my changes and put everything back as it was. What I couldn't heal was that the box where to enter the password was used to be displayed twice. The second box was a little lower and could be seen on larger displays only once you scrolled.

    Today I wanted to continue. What I saw was different to Friday. Now the box where you enter the credentials is completely gone and there is a white box above the background image. The page on Friday was definitely w/o a white box and yes, I've cleaned my caches. However, the page background setting is empty. So there should be just the default greenish background and the box visible, shouldn’t it?


    Post edited by MLG76 on
  • AirAir
    Posts: 10,970
    Hey :-)

    Are you working on the original template for password protected that came with the page, or you are making your own from the scratch?

    I can not fully visualize what issues you are facing, so it would be great to add screen shots as well.

    With kind regards.
  • Posts: 89
    Hi Air,

    thanks very much for your help.

    I'm working with the stock template as it came with the original theme. I've made a clean installation for the final website, in order to make sure not to inherit any eventual problems. I was really after not touching at, as I was already a bid freightened. So I made a big round around it and wanted to work on it not earlier then when everything else is set.

    Have attached a screenshot.

    Bildschirmfoto 2019-11-25 um 17.39.23.png
    2742 x 1670 - 998K
  • AirAir
    Posts: 10,970
    Hey :-)

    I have spend some time on this on your website.

    It seems deactivating "WP Meta SEO" plugin solves the issue.

    Remember to test preview on the protected album, not on that page that you are desiging. I know, it is a bit crazy:-)

    https://yoursite.photo/album/photo-proofing-iii/

    With kind regards.
  • edited November 2019 Posts: 89
    Thanks for your help once again.

    Have deactivated 'WP Meta SEO' (used it only to speed up altering the meta texts).

    Finally I now remember, why I couldn't reproduce the second credential field problem earlier this day. It was because I've opened the page instead of the album. Will test only with the album from now on.

    For 'Protected Page' I've set now at "Hide content under header" the setting "Turn it off", so that this large headline is no longer shown. Like that things are fine for me. Changing the header now also works as expected.

    One more question: As soon as I enter the password and login, the browser never asks for it again but shows me immediately the protected album - even if I delete my cache. Not sure if that is Mac-specific. But where does it store it? I've checked my Mac's keychain, but it's not saved there as password. I also couldn't find any setting in WP. My workaround was to set a new and set it afterwards back to "demo", which worked.

    Post edited by MLG76 on
  • AirAir
    edited November 2019 Posts: 10,970
    Hello :-)
    MLG76 said: I also couldn't find any setting in WP
    This is purely WordPress mechanism. As soon as you provide valid password, cookie is created in your broswer that will not ask for a password for this post again.

    What is more, if you add the same password("demo" in this case) for other pages/posts/albums, then all of them will be unlocked at once, as cookie is already created.
    More details here https://kinsta.com/blog/password-protect-wordpress-site/#post

    With kind regards.
    Post edited by Air on
  • edited November 2019 Posts: 89
    Thanks for this informative article.

    Is that cookie a technical 'must have' to use the password protection? If not, how can I pull its plug? You might know why I'm asking. It's because of latest GDPR requirements. I would like to work w/o these annoying cookie consent banners.

    Post edited by MLG76 on
  • AirAir
    Posts: 10,970
    Hey :-)

    Sorry, but I don't know any details about this. This is the default WordPress part, not really part of the theme. You would have to ask about it on a general WordPress forum and how it affects GDPR.

    With kind regards.
  • Posts: 89
    Okay, no problem. Makes sense. Will check that out.

  • Posts: 89
    Hi Air,

    please apologize for refreshing this.

    Just noticed that 'Yoast SEO' creates the similar effect like WP Meta SEO did. Once I call up the password protected album, the credential page is displayed weird (e.g. form for password far too much at bottom + displayed twice + weird header). As soon as I deactivate Yoast SEO temporarily the credential page looks as it should.

    Good.png
    3094 x 1976 - 5M
    Bad I.png
    3098 x 1982 - 4M
    Bad II.png
    3094 x 1980 - 5M
  • AirAir
    Posts: 10,970
    Hey :-)

    I will try to recreate this issue and check if I can come up with some solution.

    I will reply in few days.

    With kind regards.
  • edited January 2020 Posts: 89
    Okay. Thanks very much. Just let me know, if I can help in any way.

    PS: I found this solution yesterday. https://gist.github.com/amboutwe/1c847f9c706ff6f8c9eca76abea23fb6/
    However, from the coding perspective it's is not sexy, as you would have to insert manual code to a single page. And as we know in general, too many manual edits and tweaks often create support problems at longterm perspective. ;-)
    Post edited by MLG76 on
  • AirAir
    Posts: 10,970
    As soon as I will get some details I will let you know.

    That code that you have linked you can put fine in the child theme in functions.php, and it should work fine.

    When I will come up with a different solution I will let you know. However, I suspect that I will end up adding the same code, but in the theme, for pages where password protected template is called.

    With kind regards.
  • Posts: 89
    Okay. Thanx for investigating this further. If there isn't any workaround I will have to go with the above suggested way.
  • Posts: 89
    Hi,

    have tried the above mentioned solution. However, it doesn't work as it should.

    The page 'Protected Page' seems to use 8817 as page id.

    Thus I've added to the functions.php of the child theme. I've marked the changes I've applied to it in bold.

    /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
    /* Remove Yoast from front end for a single post or page
    * Credit: Dodinas https://stackoverflow.com/questions/37845968/disable-wordpress-yoast-seo-on-single-page
    * Last Tested: Nov 08 2019 using Yoast SEO 12.4 on WordPress 5.2.4
    *********
    * DIFFERENT POST TYPES
    * Post: Change 123456 to the post ID
    * Page: Change is_single to is_page and 123456 to the page ID
    * Custom Post Type: Change is_single to is_singular and 123456 to the 'post_type_slug'
    Example: is_singular( 'cpt_slug' )
    *********
    * MULTIPLE ITEMS
    * Multiple of the same type can use an array.
    Example: is_single( array( 123456, 234567, 345678 ) )
    * Multiple of different types can repeat the if statement
    */

    add_action( 'template_redirect', 'remove_wpseo' );
    function remove_wpseo() {
    if ( is_page ( 8817 ) ) {
    global $wpseo_front;
    if ( defined( $wpseo_front ) ) {
    remove_action( 'wp_head', array ($wpseo_front, 'head' ), 1 );
    } else {
    $wp_thing = WPSEO_Frontend::get_instance();
    remove_action( 'wp_head', array( $wp_thing, 'head' ), 1 );
    }
    }
    }
  • AirAir
    Posts: 10,970
    Hey :-)

    Please try the below code instead. I have tested it and it works fine for me.
    add_action( 'template_redirect', 'remove_wpseo' );
    function remove_wpseo() {
    	if ( post_password_required() ) {
    
    		global $wpseo_front;
    		if ( defined( $wpseo_front ) ) {
    			remove_action( 'wp_head', array ($wpseo_front, 'head' ), 1 );
    		} else {
    			$wp_thing = WPSEO_Frontend::get_instance();
    			remove_action( 'wp_head', array( $wp_thing, 'head' ), 1 );
    		}
    	}
    }
    With kind regards.
  • Posts: 89
    Hi Air,

    thanks very much.

    Added the code to child theme's functions.php

    I'm afraid to say it's not working yet for me.

    I have tried on two clients to make sure it's not a caching problem. The login site looks unchanged:

    https://lange-grumfeld.photo/album/photo-proofing-iii/

  • AirAir
    Posts: 10,970
    Hey :-)

    Could you please send me temporary* access to your WordPress and FTP so I could check there what is going on? Send it here on the forum via private message(click on my nick, in top-right corner you will find option "Message"). In message please add LINK to topic it applies to.

    By sending access to WordPress I mean:
    -create a new ADMIN account with a fake e-mail
    -set some password to this account
    -send me created login and password

    *temporary - please delete this account after I am done, for your safety!
  • AirAir
    Posts: 10,970
    Hey :-)

    Fixed. Your code didn't work, because it was commented out - in other words disabled.
    I made a change by closing the comment before the proper code starts.

    I have changed this
    /* Remove Yoast from front end for a single post or page
    to
    /* Remove Yoast from front end for a single post or page */

    With kind regards.
  • Posts: 89
    Hi Air,

    I'm embarrassed having made such a stupid mistake. *shame*

    Please apologize for any inconvenience and thanks very much for your patient help and for fixing this.
  • AirAir
    Posts: 10,970
    Not a problem. It will only help me implement the fix to the theme.

    With kind regards.
  • edited January 2021 Posts: 89
    Hi Air,

    pls apologize to warm up this thread. I just noticed, this solved problem is back unfortunately. The functions.php of the child theme is still containing the above code (see here once again):
    /* Remove Yoast from front end for a single post or page */ add_action( 'template_redirect', 'remove_wpseo' ); function remove_wpseo() { if ( post_password_required() ) { global $wpseo_front; if ( defined( $wpseo_front ) ) { remove_action( 'wp_head', array ($wpseo_front, 'head' ), 1 ); } else { $wp_thing = WPSEO_Frontend::get_instance(); remove_action( 'wp_head', array( $wp_thing, 'head' ), 1 ); } } }
    Any idea what I can do?
    Post edited by MLG76 on
  • AirAir
    Posts: 10,970
    Hey :-)

    It looks that this changed since version 14.x of Yoast.
    I have tested, and now such code will work for this:
    
    /* Remove Yoast from front end for a single post or page */
    
    add_action( 'template_redirect', 'remove_wpseo');
    function remove_wpseo() {
        if ( post_password_required() ) {
            $front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class );
    
            remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 );
            remove_action( 'wp_head', [ $front_end, 'call_wpseo_head' ], 1 );
        }
    }
    Remove the old code and use the above instead.

    With kind regards.
  • Posts: 89
    Hi Air,

    thanks very much.

    Did replace old code against the new. However, no change. :-/ Loaded with another browser in order to make sure it's not a caching issue.

    Have a look by yourself:
    https://lange-grumfeld.photo/album/photo-proofing-iii/

  • AirAir
    Posts: 10,970
    Could you please send me temporary* access to your WordPress so I could check there what is going on? Send it here on the forum via private message(click on my nick, in top-right corner you will find option "Message"). In message please add LINK to topic it applies to.

    By sending access to WordPress I mean:
    -create a new ADMIN account with a fake e-mail
    -set some password to this account
    -send me created login and password

    *temporary - please delete this account after I am done, for your safety!
  • AirAir
    edited January 2021 Posts: 10,970
    Hey :-)

    Not sure what was wrong, as I have just removed, saved, and added the above code again and it works now :-)

    Strange issues "welcome to" :-)

    Edit: Probably plugin CACHE :-)

    With kind regards.
    Post edited by Air on
  • edited January 2021 Posts: 89
    I can confirm, now it works. Excellent.

    Thank you very much.

    PS: Maybe copy/pasting from the forum to the text file adds some unwanted (invisible) entries in code? I had such problem before with CSS once.
    Post edited by MLG76 on
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!