WP_FAIL2BAN_EX_GEOLOCATION_FAIL

Deny requests when a country cannot be resolved.

Default setting: disabled

Premium flavour only


When enabled, country blocking fails closed: a request whose country cannot be resolved is denied with HTTP 403 once a country block list is in use. Omitting or spoofing geolocation therefore cannot bypass the list.

When disabled (the default), country blocking fails open: a configured country list does not apply to a request whose country cannot be resolved.

This setting has no effect when WP_FAIL2BAN_EX_GEOLOCATION is disabled, or when both country lists are empty. A resolved country that is not on either list is still allowed.

A fail-closed denial records WPF2B_EVENT_BLOCK_COUNTRY_UNKNOWN. It does not invent a country code for other Premium events; those keep a null ISO value.

Example: Deny unresolved countries when a block list is configured
define('WP_FAIL2BAN_EX_GEOLOCATION_FAIL', true);

History

Added in version 6.3.0.