1

I need to password protect a page, but from what I looked up -- the action of the form needs to use something like this:

action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '"

OR

action="' . get_option('siteurl') . '/wp-login.php?action=postpass"

which both are the exact same thing and both utilizes the wp-login.php.

The problem I am facing is that my company uses a VPN to allow access to the /wp-admin login page -- which in turn also affects the wp-login.php file. Because of this, the password protected page effect does not work for our users due to the VPN constraint and routes them to a 403 status page. Is there an alternative way to use the password protected page functionality without the action requiring the use of wp-login.php ?

I assume not, but though to ask if anyone had any insights. Whitelisting on the VPN would defeat the purpose of our use of a VPN to access the admin panel as well, so sorta stuck in a dilemma.

3
  • Did you find a solution? I have the same problem. Commented Sep 6, 2021 at 9:23
  • @PanagiotisV do not post comments as the solution to the question. It does not matter if you can or can't post comments, do not spam the site
    – Tom J Nowell
    Commented Sep 6, 2021 at 10:29
  • As for the question, the normal solution is to fix the VPN requirement to add an exception for when the action is postpass
    – Tom J Nowell
    Commented Sep 6, 2021 at 10:31

1 Answer 1

0

A couple of things you could try

  1. Use a plugin like Rename wp-login.php and change what the VPN points to from wp-login.php to whatever you rename it

  2. Use plugin to handle the post password protection. I haven't tried any, but there should be one out there that works without relying on wp-login.php. A few that came up when searching are Password Protect Page and Passster. The native way post passwords works is pretty rubbish so it wouldn't be a bad idea to change it

1
  • If the company wants a VPN to allow access to the login/wp-admin then redirecting it so that it doesn’t is counter-productive to what someone specifically wanted and set-up. Commented Jan 14, 2021 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.