WP_FAIL2BAN_EX_BLOCK_COUNTRIES_451
Block requests from specified countries with a 451 status code.
Default setting: disabled
Premium flavour only
Returns HTTP 451 “Unavailable For Legal Reasons” for requests whose resolved country appears in this list.
Do not put the same country in this list and WP_FAIL2BAN_EX_BLOCK_COUNTRIES. If an overlap exists despite that recommendation, the HTTP 403 list takes precedence, so the 403 event and response are used.
The message is deliberately neutral:
The administrator of this site has blocked access from your country.
Example: Block requests from specific countries
/**
* Block requests from specified countries
*/
define('WP_FAIL2BAN_EX_BLOCK_COUNTRIES_451', [
'FR',
'GB'
]);
Note
Country codes must be specified using ISO 3166-1 alpha-2 format.
History
Added in version 6.0.0.