
The settings page: country database and optional VPN list, per-area country lists, VPN blocking and custom block messages.
Some sites simply do not need worldwide traffic — or keep getting spam registrations and brute-force login attempts from countries they never do business with.
Wonderful Geoblocking Countries lets you block three areas of your site independently, each with its own country list and its own message:
For every area you pick the mode that fits:
On top of that, every area can also block visitors who use a VPN service — regardless of which country their VPN server is in. Without this, anyone could get around a country rule with a VPN.
Blocked visitors receive an HTTP 403 response with your custom message (basic HTML allowed).
Built-in safety rails:
Two free data sources, stored on your server:
Both updates run automatically and can be switched off at any time; the Download / update databases now button fetches both at once.
Sites behind a CDN or reverse proxy can feed the real visitor IP (or a ready-made country code, e.g. from Cloudflare’s CF-IPCountry header) into the plugin via the wonderful_geoblocking_countries_client_ip and wonderful_geoblocking_countries_pre_country_code filters.
This plugin uses IP2Location LITE data available from https://lite.ip2location.com. The optional VPN list is built from data by X4BNet (https://github.com/X4BNet/lists_vpn, MIT license), antonme/ipranges (https://github.com/antonme/ipranges, CC0) and RIPE NCC RIPEstat (https://stat.ripe.net/).
This plugin connects to three external services. All of them are only contacted to download data files onto your server; no data about your visitors is ever transmitted.
IP2Location (country database). The plugin downloads the IP2Location LITE geolocation database from www.ip2location.com. The download only happens when you actively configure it: you enter your personal download token and click the download button (afterwards a monthly scheduled refresh re-downloads the database with the same token). The token you obtained from your lite.ip2location.com account is sent to www.ip2location.com as part of the download request. This service is provided by IP2Location.com: terms of use, privacy policy.
GitHub (VPN list, optional). Only if you enable the VPN list, the plugin downloads the text files of the X4BNet VPN list (https://github.com/X4BNet/lists_vpn) and the VPN and iCloud Private Relay lists of antonme/ipranges (https://github.com/antonme/ipranges) from raw.githubusercontent.com — when you click the download button and then once a week. The request contains no personal data besides the usual technical connection data (your server’s IP address). This service is provided by GitHub, Inc.: terms of service, privacy statement.
RIPEstat (VPN list, optional). Only if you enable the VPN list, the plugin asks the RIPEstat Data API (stat.ripe.net) for the IP prefixes announced by a few networks that are run only for VPN servers — at the same times as the GitHub download. The request contains only the network number (e.g. AS147049) and no personal data besides the usual technical connection data (your server’s IP address). This service is provided by RIPE NCC: terms of service, privacy statement.
All lookups for your visitors (country and VPN) happen locally on your server against the downloaded files — visitor IP addresses never leave your site.