Wonderful Geoblocking Countries icon

Wonderful Geoblocking Countries

Control access by country, for your site, logins or registrations.

Screenshot of Wonderful Geoblocking Countries

Take control of who can reach your WordPress site. Wonderful Geoblocking Countries lets you block three areas independently — the whole public site, the login page, and the user registration form — each with its own country list and its own message.

The settings page: database setup and per-area country lists with custom block messages.

For every area you choose the mode that fits: a block list (keep out visitors from the selected countries) or an allow list (let in only the selected countries and block everyone else). Blocked visitors receive an HTTP 403 response with your own message (basic HTML allowed).

Privacy-first geolocation: country lookups run locally on your server against the free IP2Location LITE database — no visitor IP is ever sent to a third-party API. The database installs with your personal download token and refreshes itself automatically about once a month (which you can switch off at any time).

Built-in safety rails: logged-in administrators are never blocked, the WordPress admin and the login page stay reachable from the site-access rule, and visitors whose country cannot be determined are always let through — so you cannot lock yourself out by accident.

For developers: a wonderful_geoblocking_countries_country_for_ip filter lets other plugins reuse the local IP2Location country lookup for any IP address, without a hard dependency on this plugin — $country = apply_filters( 'wonderful_geoblocking_countries_country_for_ip', '', $ip );.

What's new in 1.0.3

  • Fixed: the 1.0.2 package was missing the bundled Select2 library, so the country lists on the settings page showed up as plain multi-select boxes. The release build now always ships it.
  • Improved: mode, countries and block message of each area are collapsible — expanded while the area is enabled, collapsed otherwise, and always one click away so you can configure an area before switching it on.

Version 1.0.3 — View on WordPress.org

Questions about this tool? Get in touch.