The associative array for validation.


The filter hook “ip-geo-block-xxxxx” where xxxxx is one of comment, xmlrpc, login, admin and public can affect the validation of this plugin.


Here are the keys and values in this associative array.

Key Value
ip IP address
auth authenticated or not
code country code
time processing time
provider geolocation API
result validation result

Use case

function my_whitelist( $validate ) {
    $whitelist = array(
        'JP', // should be upper case

    $validate['result'] = 'blocked';

    if ( in_array( $validate['code'], $whitelist ) ) {
        $validate['result'] = 'passed';

    return $validate;
add_filter( 'ip-geo-block-login', 'my_whitelist' );
add_filter( 'ip-geo-block-admin', 'my_whitelist' );
NOTE: When you select "mu-plugins" (ip-geo-block-mu.php) as Validation timing , you should put your code snippet into drop-in.php in Geolocation API folder instead of functions.php. See My custom functions in “functions.php” doesn’t work. in FAQ for detail.