skip to Main Content

I have a site and its running WordPress 5.7 and I have 2 password protected pages and when I goto login to these pages I get a white screen after logging in. The URL that I get redirected to is: /wp-login.php?action=postpass I have tried the following solutions:

  • Download a fresh version of WordPress and replaced wp-login.php on my site with the fresh one.
  • Deactivated all my plugins
  • Deactivated my theme and switched to the default one (Twenty Nineteen)

And none of those worked, anyone got any other solution to this issue?

Thanks,

4

Answers


  1. Since August 2020, Chrome and other browsers STARTED rolling a tighter referrer policy with a default to strict-origin-when-cross-origin.

    Web developers may specify a referrer policy on their documents, which impacts the Referer header sent on outgoing requests and navigations. When no policy is specified, Chrome will now use strict-origin-when-cross-origin as the default policy, instead of no-referrer-when-downgrade.

    Adding with no-referrer-when-downgrade should supposedly force a referrer downgrade to it’s previous status.

    <meta name="referrer" content="no-referrer-when-downgrade">
    

    (Even tho that might fix it, it might not be the best option, as it might become mandatory in a near/far future to roll with a tighter one, as law changes in regards to privacy across countries).

    Tho the impact is supposed to be limited, you might be falling under that category. And you’re not the only one.

    Based on discussions with other browsers and Chrome’s own experimentation run in Chrome 84, user-visible breakage is expected to be limited.

    A complete in-details post as been published by the beautiful people at Google, don’t hesitate to take a look. They have a section, "If this impacts your site, consider alternatives".

    Login or Signup to reply.
  2. It is hard to say exactly what is going on with such limited information. Analysis of the code in wp-login.php shows that the described issue could happen if there is no $_SERVER['HTTP_REFERER'] in the request. I have reproduced the issue adding

    unset( $_SERVER['HTTP_REFERER'] );
    

    before line 650

    $referer = wp_get_referer();
    

    in wp-login.php.

    To check that the issue is related to the referrer, please try to insert the line

    var_dump( $_SERVER['HTTP_REFERER'] );
    

    before the same line 650 in wp-login.php (and don’t forget to remove it later), and let me know the output – you have to see it on the white screen.

    It seems to me you will have the following message:

    Warning: Undefined array key "HTTP_REFERER" in ...wp-login.php on line 650
    NULL
    

    The question is – why don’t you have a referrer here.

    Browser does not provide a referrer doing the HTTP request from an HTTPS page. If the site was moved to HTTPS incorrectly, the form can contain the action field with http:.

    Some browser extensions can also make tricks. Please deactivate all of them.

    Login or Signup to reply.
  3. i had same problem to solve my issue i go to wp-includes/post-template.php

    and search the funciton get_the_password_form()

    and add this

    <input type="hidden" name="_wp_http_referer" value="'.get_permalink().'" />

    after $output
    and also add this ( apply_filters( ‘the_password_form’, $output );
    return $output; )

    it is work for me

    Login or Signup to reply.
  4. I just had the same problem. Then noticed that we have the domain in wordpress with www. but they set a link to the protected page without www. When I enter the password without www it gets redirected to the domain without www and have no cookie for this domain, thus not logged in and white page. I added a redirect from non www to www domain in htaccess to be sure the domain is correct and it worked!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search