Viewing 3 replies - 1 through 3 (of 3 total)
  • This plugin doesn’t do it out of the box.
    However you can use a filter to do this.

    Something along the lines of:

    function password_protected_check_ip( $bool ) {
    	// Check the IP address here and return 0 (ie disabled) if you want to allow the IP address
    	return $bool;
    }
    add_filter( 'pre_option_password_protected_status', 'password_protected_check_ip' );
    Thread Starter Taylor Baybutt

    (@taxbax)

    Awesome!! Thanks very much Ben. Will try to implement now.

    Thread Starter Taylor Baybutt

    (@taxbax)

    AND, it works!

    In case anyone comes across this looking for the solution, it is as simple as this;

    function password_protected_check_ip( $bool ) {
    	// Check the IP address here and return 0 (ie disabled) if you want to allow the IP address
    	if($_SERVER['REMOTE_ADDR'] == "160.79.66.166") {
    	$bool = 0;
    	}
    	return $bool;
    }
    add_filter( 'pre_option_password_protected_status', 'password_protected_check_ip' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can one auto-authorize based on visited IP?’ is closed to new replies.