This filter modifies the range of IP addresses that are considered blocked or malicious by the Geo Controller plugin.
You can use this filter to manually add or override IP addresses and their subnet masks that should be restricted from accessing your website.
Note: Modifying this filter affects the functionality of the entire plugin and may block legitimate users if not used carefully.
Usage
function example_callback( $blocked_ip ) { // Modify the $blocked_ip array return $blocked_ip; } add_filter( 'cf_geoplugin_ip_blocked', 'example_callback', 1 );
Example
If you want to block specific IP addresses or ranges, use the following code:
if ( ! function_exists( 'change_cf_geoplugin_ip_blocked' ) ) { function change_cf_geoplugin_ip_blocked( $blocked_ip ) { // Define new blocked IPs with subnet mask $new_ips = array( '192.0.2.0' => 24, '192.88.99.5' => 24, '192.168.0.0' => 8, '192.168.1.0' => 255, // Add more as needed ); // Merge with existing list return array_merge( $blocked_ip, $new_ips ); } } add_filter( 'cf_geoplugin_ip_blocked', 'change_cf_geoplugin_ip_blocked', 1 );
Note: Each entry in the array should contain the IP address as the key and the subnet mask as the value. Be sure to understand IP masking before applying this filter in production.