Title: Wonderful Geoblocking Countries
Author: wonderfulplugins
Published: <strong>25 de julio de  2026</strong>
Last modified: 4 de octubre de  2026

---

Buscar plugins

![](https://ps.w.org/wonderful-geoblocking-countries/assets/icon-256x256.png?rev
=3622600)

# Wonderful Geoblocking Countries

 Por [wonderfulplugins](https://profiles.wordpress.org/wonderfulplugins/)

[Descargar](https://downloads.wordpress.org/plugin/wonderful-geoblocking-countries.1.2.1.zip)

 * [Detalles](https://es-ar.wordpress.org/plugins/wonderful-geoblocking-countries/#description)
 * [Valoraciones](https://es-ar.wordpress.org/plugins/wonderful-geoblocking-countries/#reviews)
 *  [Instalación](https://es-ar.wordpress.org/plugins/wonderful-geoblocking-countries/#installation)
 * [Desarrollo](https://es-ar.wordpress.org/plugins/wonderful-geoblocking-countries/#developers)

 [Soporte](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/)

## Descripción

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:

 * **Site access** — the whole public frontend.
 * **Login** — the wp-login.php page.
 * **Registration** — the user registration form.

For every area you pick the mode that fits:

 * **Block list** — block visitors from the selected countries and allow everyone
   else.
 * **Allow list** — allow only the selected countries and block everyone else (e.
   g. “only visitors from Austria, Germany and Switzerland may log in”).

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:**

 * Logged-in administrators are never geoblocked, so you cannot lock yourself out
   of a site you are logged in to.
 * The WordPress admin and the login page are never affected by the _site access_
   rule — login blocking is its own explicit setting.
 * Visitors whose country cannot be determined are never blocked.

**Two free data sources, stored on your server:**

 * **Country database (required)** — the free IP2Location LITE country database (
   IPv4 + IPv6). It is _not_ bundled: you create a free account at lite.ip2location.
   com, paste your personal download token into the settings, and the plugin downloads
   the database (a few MB) onto your server. It refreshes itself about once a month.
 * **VPN list (optional)** — the IP ranges of the common VPN providers, combined
   from three free sources because none of them is complete on its own: the [X4BNet VPN list](https://github.com/X4BNet/lists_vpn)(
   MIT license), the VPN server lists of [antonme/ipranges](https://github.com/antonme/ipranges)(
   CC0, taken from the providers’ own server feeds), and all networks of pure VPN
   operators via [RIPEstat](https://stat.ripe.net/). iCloud Private Relay is removed
   from the list — it hides ordinary iPhone users and is no VPN service. Switch 
   it on with one checkbox — no account or token needed. The plugin downloads it
   onto your server and refreshes it every week. Only needed if you use the _VPN_
   option of an area.

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/).

### External services

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](https://www.ip2location.com/terms), [privacy policy](https://www.ip2location.com/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](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service),
[privacy statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-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](https://www.ripe.net/about-us/legal/ripestat-service-terms-and-conditions/),
[privacy statement](https://www.ripe.net/about-us/legal/ripe-ncc-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.

## Capturas

[⌊The settings page: country database and optional VPN list, per-area country lists,
VPN blocking and custom block messages.⌉⌊The settings page: country database and
optional VPN list, per-area country lists, VPN blocking and custom block messages
.⌉[

The settings page: country database and optional VPN list, per-area country lists,
VPN blocking and custom block messages.

## Instalación

 1. Upload the `wonderful-geoblocking-countries` folder to the `/wp-content/plugins/`
    directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Create a free account at [lite.ip2location.com](https://lite.ip2location.com/) 
    and copy your download token.
 4. Go to **Settings > Geoblocking Countries**, paste the token, save, and click **
    Download / update database now**.
 5. Optional: tick _VPN list_, save, and download again to also block VPN users.
 6. Pick the countries to block per area (and tick _VPN_ where you want to block VPN
    users), write your block messages, done!

## Preguntas frecuentes

### Why is the geolocation database not included in the plugin?

The IP2Location LITE database is free but published under its own license that requires
every user to register for their own copy. The download with your personal token
takes less than a minute and enables automatic monthly updates.

### What happens while no database is installed?

Nothing — no visitor is blocked. The plugin shows an admin notice until a database
is installed, and visitors whose country cannot be determined are always let through.

### Can I lock myself out?

Not while you are logged in: administrators are always exempt from all three rules.
Only the _login_ rule can affect you when you are logged out and your own country
is on its list — the settings page warns you about exactly that.

### My site runs behind Cloudflare or another proxy — the detected country is wrong.

Behind a proxy, `REMOTE_ADDR` is the proxy’s address, not the visitor’s. Use the`
wonderful_geoblocking_countries_client_ip` filter to supply the real client IP from
a header you trust, or short-circuit the lookup entirely with `wonderful_geoblocking_countries_pre_country_code`(
e.g. return the value of Cloudflare’s `CF-IPCountry` header).

### Does blocking also apply to the REST API and feeds?

The _site access_ rule runs on every frontend request, including feeds and the REST
API. The WordPress admin (including admin-ajax) and wp-login.php are excluded from
it.

### How does VPN blocking work, and how reliable is it?

Tick _VPN list_ under _Databases_ and download it, then tick _VPN_ in every area
where VPN users should be blocked. A visitor whose IP lies in a range of a known
VPN provider is then blocked — regardless of the country and even in allow-list 
mode (otherwise a VPN server in an allowed country would be a way in).

The list combines the X4BNet list, the server lists of the big providers (NordVPN,
Surfshark, ExpressVPN, ProtonVPN, Mullvad, PIA and others) and the complete networks
of pure VPN operators, and is updated daily. iCloud Private Relay is never counted
as a VPN. No free list catches every VPN, though: small or self-hosted VPNs, Tor
and residential proxies are usually not included. Logged-in administrators are never
blocked, VPN or not.

### Why not the IP2Proxy LITE database?

We tried it: the free IP2Proxy LITE edition only lists open public proxies — no 
VPN servers and no Tor exits (those are reserved for the paid edition) — and is 
more than 1 GB in size. The combined VPN list takes about 120 KB on your server 
and actually recognises VPN providers.

### Can other plugins use the VPN list?

Yes. Once the VPN list is installed:

    ```
    $is_vpn = apply_filters( 'wonderful_geoblocking_countries_is_vpn_ip', null, $ip );
    ```

It returns `true` or `false`, and the default (`null`) while the VPN list is disabled
or not installed.

### Is any visitor data sent to a third party?

No. Country lookups run locally against the downloaded database file. The only external
request is the database download itself, which you trigger with your own token.

## Reseñas

![](https://secure.gravatar.com/avatar/c76a8144165a606f389e5796c0b65958c2d1de41943b8321201f83faa2f9e2b8?
s=60&d=retro&r=g)

### 󠀁[Wonderful idea, brilliantly simple](https://wordpress.org/support/topic/wonderful-idea-brilliantly-simple/)󠁿

 [hellu24](https://profiles.wordpress.org/hellu24/) 21 de septiembre de 2026

What a wonderful idea, and so brilliantly and simply solved. Thank you so much for
this plugin!

 [ Leer la 1 reseña ](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/)

## Colaboradores y desarrolladores

“Wonderful Geoblocking Countries” es un software de código abierto. Las siguientes
personas han colaborado con este plugin.

Colaboradores

 *   [ wonderfulplugins ](https://profiles.wordpress.org/wonderfulplugins/)

“Wonderful Geoblocking Countries” ha sido traducido a 1 idioma. Gracias a [los traductores](https://translate.wordpress.org/projects/wp-plugins/wonderful-geoblocking-countries/contributors)
por sus contribuciones.

[Traduce “Wonderful Geoblocking Countries” a tu idioma.](https://translate.wordpress.org/projects/wp-plugins/wonderful-geoblocking-countries)

### ¿Interesado en el desarrollo?

[Revisa el código](https://plugins.trac.wordpress.org/browser/wonderful-geoblocking-countries/),
echa un vistazo al [repositorio SVN](https://plugins.svn.wordpress.org/wonderful-geoblocking-countries/),
o suscríbete al [log de desarrollo](https://plugins.trac.wordpress.org/log/wonderful-geoblocking-countries/)
por [RSS](https://plugins.trac.wordpress.org/log/wonderful-geoblocking-countries/?limit=100&mode=stop_on_copy&format=rss).

## Registro de cambios

#### 1.2.1

 * Added an explainer video to the plugin description.

#### 1.2.0

 * Improved: much better VPN detection. The VPN list now combines the X4BNet list
   with the server lists of the big VPN providers (antonme/ipranges) and all prefixes
   of networks that are run only for VPN servers (via RIPEstat). The X4BNet list
   alone missed more than a third of the NordVPN servers.
 * Fixed: iCloud Private Relay is no longer treated as a VPN, so iPhone users with
   Private Relay are not blocked.
 * Added: `wonderful_geoblocking_countries_vpn_asns` filter to add more VPN networks(
   AS numbers).

#### 1.1.1

 * Improved: added a “Clear all” link to the country lists, so all selected countries
   of an area can be removed with one click.

#### 1.1.0

 * Added: VPN blocking. Every area (site access, login, registration) can now also
   block visitors who use a VPN service, regardless of their country. It uses the
   free X4BNet VPN list (optional, about 200 KB, no token needed), which the plugin
   downloads onto your server and refreshes every week.
 * Added: `wonderful_geoblocking_countries_is_vpn_ip` filter so other plugins can
   reuse the VPN list.
 * Improved: the database section of the settings page is clearer — the required
   country database and the optional VPN list each show their own status, and one
   button updates both.
 * Improved: the settings page shows whether your current IP is on the VPN list.
 * Improved: downloaded databases are validated before they replace the installed
   file, and archives are unpacked without loading them into memory.

#### 1.0.3

 * Fixed: the 1.0.2 release package was missing the bundled Select2 library (the
   build skipped the production dependencies), so the country lists on the settings
   page rendered as plain multi-select boxes. The build process now always ships
   it.
 * Improved: mode, countries and block message of each area are now collapsible 
   on the settings page — expanded while the area is enabled, collapsed otherwise(
   still one click away, so you can configure an area before switching it on). The
   page is much easier to read.
 * Tested up to WordPress 7.1.

#### 1.0.2

 * Updated the bundled Select2 library from the 4.1.0 release candidate to the stable
   4.1.0 release (now managed via Composer).
 * Fixed the IP2Location terms-of-use link in the readme.
 * Corrected the “Tested up to” header to a major.minor WordPress version.

#### 1.0.1

 * Added a `wonderful_geoblocking_countries_country_for_ip` filter so other plugins
   can reuse the IP2Location country lookup.

#### 1.0.0

 * Initial release.

## Meta

 *  Versión **1.2.1**
 *  Última actualización **hace 2 semanas**
 *  Instalaciones activas **10+**
 *  Versión de WordPress ** 6.2 o superior **
 *  Testeado hasta **7.1.3**
 *  Versión de PHP ** 7.4 o superior **
 *  Idiomas
 * [English (US)](https://wordpress.org/plugins/wonderful-geoblocking-countries/)
   y [German](https://de.wordpress.org/plugins/wonderful-geoblocking-countries/).
 *  [Traducir a tu idioma](https://translate.wordpress.org/projects/wp-plugins/wonderful-geoblocking-countries)
 * Etiquetas:
 * [country block](https://es-ar.wordpress.org/plugins/tags/country-block/)[Geoblocking](https://es-ar.wordpress.org/plugins/tags/geoblocking/)
   [geolocation](https://es-ar.wordpress.org/plugins/tags/geolocation/)[security](https://es-ar.wordpress.org/plugins/tags/security/)
 *  [Vista avanzada](https://es-ar.wordpress.org/plugins/wonderful-geoblocking-countries/advanced/)

## Valoraciones

 5 de 5 estrellas.

 *  [  1 valoración de 5 estrellas     ](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/?filter=5)
 *  [  0 valoraciones de 4 estrellas     ](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/?filter=4)
 *  [  0 valoraciones de 3 estrellas     ](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/?filter=3)
 *  [  0 valoraciones de 2 estrellas     ](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/?filter=2)
 *  [  0 valoraciones de 1 estrellas     ](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/#new-post)

[Ver todas las reseñas](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/reviews/)

## Colaboradores

 *   [ wonderfulplugins ](https://profiles.wordpress.org/wonderfulplugins/)

## Soporte

¿Tenés algo que decir? ¿Necesitás ayuda?

 [Ver el foro de asistencia](https://wordpress.org/support/plugin/wonderful-geoblocking-countries/)