Title: Whitelist?
Last modified: August 3, 2017

---

# Whitelist?

 *  Resolved [pako69](https://wordpress.org/support/users/pako69/)
 * (@pako69)
 * [9 years ago](https://wordpress.org/support/topic/whitelist-11/)
 * Hi
 * Just discover you plugin after testing a ton of others captcha plugin and it 
   looks like very cool 🙂
 * But what about a whitelist option? Or maybe you can give us a little php snipet
   that can do the trick?
 * Something like:
 *     ```
       if(isset($_SERVER['REMOTE_ADDR'])) {
         	$My_Remote_ip = $_SERVER['REMOTE_ADDR'];
       	if ($My_Remote_ip != 'XXX.XXX.XXX.XXX') {
       		define('XRVEL_LOGIN_RECAPTCHA_ENABLED', true);
       	} else {
       		define('XRVEL_LOGIN_RECAPTCHA_ENABLED', false);
       	}
       }
       ```
   
 * or the one below if using a proxy:
 *     ```
       if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         	$Zxffaddrs = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
         	$My_Remote_ip = $Zxffaddrs[0];
       	if ($My_Remote_ip != 'XXX.XXX.XXX.XXX') {
       		define('XRVEL_LOGIN_RECAPTCHA_ENABLED', true);
       	} else {
       		define('XRVEL_LOGIN_RECAPTCHA_ENABLED', false);
       	}
       }
       ```
   
 * Those code are the one I’m using with another WP Google reCaptcha, so they are
   just exemples.
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [pako69](https://wordpress.org/support/users/pako69/)
 * (@pako69)
 * [9 years ago](https://wordpress.org/support/topic/whitelist-11/#post-9375758)
 * I had this below in your invisible-recaptcha.php and it works, but it will be
   better to have an option in your settings 🙂
 *     ```
       if ( ! is_admin() ) {
       if(isset($_SERVER['REMOTE_ADDR'])) {
         	$My_Remote_ip = $_SERVER['REMOTE_ADDR'];
       	if ($My_Remote_ip == 'XXX.XXX.XXX.XXX') {
       		return;
       	} 
       }
       if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         	$Zxffaddrs = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
         	$My_Remote_ip = $Zxffaddrs[0];
       	if ($My_Remote_ip != 'XXX.XXX.XXX.XXX') {
       		return;
       	}
       }
       }
       ```
   
 *  [MihChe](https://wordpress.org/support/users/mihche/)
 * (@mihche)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/whitelist-11/#post-9409721)
 * Hi [@pako69](https://wordpress.org/support/users/pako69/),
    Basically you want
   to disable protection based on some IPs? Let me understand what you’d like to
   accomplish and I’ll help you with this.
 * ~Mihai
 *  Thread Starter [pako69](https://wordpress.org/support/users/pako69/)
 * (@pako69)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/whitelist-11/#post-9420641)
 * Hi [@mihche](https://wordpress.org/support/users/mihche/)
    “_Basically you want
   to disable protection based on some IPs?_” Yes… 🙂 and behind or not a proxy 
   Thanks
 *  [motivmedia](https://wordpress.org/support/users/motivmedia/)
 * (@motivmedia)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/whitelist-11/#post-9485323)
 * Hi. I’d also love to see this as an option. Like setting a list of host names(
   don’t have a static IP) for which the Captcha is omitted altogether. For illustration,
   is_whitelisted in the quick’n’dirty example would determine if the Captcha should
   be used or not. Anything like that in the works yet? 🙂
 *     ```
       $whitelisthosts[] = 'dyn.example.com';
       $whitelisthosts[] = 'dyn.example.net';
   
       function is_whitelisted()
       {
       	global $whitelisthosts;
       	$ip = $_SERVER['REMOTE_ADDR'];
       	foreach ($whitelisthosts as $whitelisthost)
       	{
       		if ($ip == gethostbyname($whitelisthost))
       		{
       			return true;
       		}
       	}
       	return false;
       }
       ```
   
 * While the global array should rather be built from a list specified on the options
   page.
    -  This reply was modified 8 years, 11 months ago by [motivmedia](https://wordpress.org/support/users/motivmedia/).
    -  This reply was modified 8 years, 11 months ago by [motivmedia](https://wordpress.org/support/users/motivmedia/).
    -  This reply was modified 8 years, 11 months ago by [motivmedia](https://wordpress.org/support/users/motivmedia/).
    -  This reply was modified 8 years, 11 months ago by [motivmedia](https://wordpress.org/support/users/motivmedia/).
      Reason: Couldn't get the code displayed correctly

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Whitelist?’ is closed to new replies.

 * ![](https://ps.w.org/invisible-recaptcha/assets/icon-256x256.png?rev=3622043)
 * [Invisible reCaptcha](https://wordpress.org/plugins/invisible-recaptcha/)
 * [Support Threads](https://wordpress.org/support/plugin/invisible-recaptcha/)
 * [Active Topics](https://wordpress.org/support/plugin/invisible-recaptcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/invisible-recaptcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/invisible-recaptcha/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [motivmedia](https://wordpress.org/support/users/motivmedia/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/whitelist-11/#post-9485323)
 * Status: resolved