IP2Location Country Blocker


This plugin will NOT work if any cache plugin is enabled.

This plugin enables user to block unwanted traffic from accessing your frontend (blog pages) or backend (admin area) by countries or proxy servers. It helps to reduce spam and unwanted sign ups easily by preventing unwanted visitors from browsing a particular page or entire website.


  • Te permite bloquear el acceso desde múltiples países.
  • Te permite bloquear el acceso por agrupación de países, por ejemplo EU, APAC, etcétera .
  • Te permite bloquear el acceso desde proxies anónimos.
  • Te permite bloquear el acceso según el rango de IP.
  • Te permite autorizar el ingreso de los robots de los buscadores a tu lista blanca, por ejemplo Google, Bing, Yandex, etcétera, al índice de tus páginas (SEO amigable).
  • Soporta IPv4 y IPv6
  • Por defecto en el error 403 (Acceso Denegado) este es el mensaje:
  • Te permite configurar tu página 403.
  • Te envía un correo electrónico de aviso si alguien está intentando acceder a tu área de administración.
  • Te muestra un reporte estadístico del tráfico bloqueado.

Este plugin es compatible con los datos BIN de IP2Location y con el servicio web para la búsqueda de geolocalización IP. Si deseas usar los datos BIN de geolocalización de IP2Location, puedes descargar y actualizar fácilmente los datos BIN a través de la página de ajustes del plugin. Como alternativa, también puedes descargar y actualizar el archivo de datos BIN manualmente usando los siguientes enlaces:

Descargar el archivo de geolocalización IP:
Base de datos de IP2Location y IP2Proxy LITE (Gratis)
Base de datos comercial de IP2Location y IP2Proxy (Completa)

To use the IP2Location IP geolocation web service (REST API) for geolocation, you’ll need to register an account at IP2Location.io IP Geolocation API. A free plan is available.

Más información

Visítanos en https://www.ip2location.com


  • Country lookup by ip address - Allow you to perform country lookup by entering a IP address.
  • Bloqueo frontend -Selecciona países que prefieras bloquear para que no puedan acceder a tus páginas del blog . Redirección de página soportada.
  • Bloqueo backend - Selecciona países que prefieras bloquear para que no puedan acceder a tu página del área de administración (wp-login). Redirección de página soportada.
  • Página de error personalizada - Personalizar tu página de error para que encaje con tu tema de wordpress.
  • Alerta Email - Te notifica con detalles cuando un usuario está intentando ingresar a tu página de administración.


Usando el Panel de Control de WordPress

  1. Selecciona Plugins -> Agregar Nuevo.
  2. Buscar «IP2Location Country Blocker».
  3. Clic en Instalar ahora para instalar el plugin.
  4. Click on Activate button to activate the plugin.
  5. Register a download account https://lite.ip2location.com (Free) or https://www.ip2location.com (Commercial).
  6. Get the download token from your account page.
  7. Go to «Country Blocker» form WordPress sidebar.
  8. Go through the setup wizard step by step.
  9. Puede comenzar a utilizar IP2Location Bloqueo por Países para bloquear visitantes.

Instalación Manual

  1. Upload the plugin to /wp-content/uploads/ip2location directory.
  2. Activa el plugin desde el menú ‘Plugins’ de WordPress.
  3. Descargar la base de datos IP2Location desde https://lite.ip2location.com/database/ip-country (Gratuita) o https://www.ip2location.com/databases/db1-ip-country (Comercial).
  4. Descargar la base de datos de IP2Proxy desde https://lite.ip2location.com/database/px1-ip-country (Gratuita) o https://www.ip2location.com/databases/px1-ip-country (Comercial).
  5. Decompress the .BIN file and upload to wp-content/uploads/ip2location.
  6. Si tienes un web service de IP2Location adquirido en https://www.ip2location.com/web-service, ingresa tu API key en la pestaña de configuraciones.
  7. Si tienes un web service de IP2Proxy adquirido en https://www.ip2location.com/ip2proxy-web-service, ingresa tu API key en la pestaña de configuraciones.
  8. Puede comenzar a utilizar IP2Location Bloqueo por Países para bloquear visitantes.

Please take note that this plugin requires minimum PHP version 5.4.

  • If you are using IP2Location LITE database, please follow these instructions to add attribution into your website.


Do I need to download the BIN file after the plugin installation?

Yes, please download the latest DB1 BIN file for a quick test from https://lite.ip2location.com/database/ip-country

Where can I download the BIN file?

You can download the free LITE edition at https://lite.ip2location.com or commercial edition at https://www.ip2location.com. Decompress the downloaded .BIN file and upload it to wp-content/uploads/ip2location.

Do I need to update the BIN file?

Te alentamos a que actualices tu archivo BIN de manera periódica cada mes, de esta manera el plugin trabajará con los últimos registros de la consulta de la geolocalización de IP. La actualización usualmente se encuentra lista en la primera semana de cada mes calendario.

What is the frontend?

El frontend significa tus páginas del blog.

What is the backend?

El backend significa la página de administración de WordPress.

Can I select multiple countries for blocking?

Si, puedes.

Can I send an 403 page on blocked IP?

Si, puedes usar el 403 provisto en este plugin por defecto.

Can I custom my own error page?

Yes, you can create a new page on wordpress and design your own error display. Once completed, you can mark your error page as «private» and configure the error redirection at the setting page.

Can I configure email notification if someone tries to access my admin page?

Si, puedes configurar el aviso por correo electrónico si un usuario bloqueado desde la lista de países intenta acceder a tu página de administración.

Does this plugin works with «Cache Plugin», such as W3 Total Cache?

No. Tienes que desactivar el «plugin de caché» para que nuestro plugin funcione correctamente.

¿Cómo puedo probar que funciona el plugin?

Please visit https://www.locabrowser.com for proxy/VPN services to test the geolocation result.

I can’t access my website, deactivating or uninstalling does not change anything

It might be a problem with your local caches. Please clear your server and browser cache.

Unable to find your answer here?

Envíanos un correo electrónico a support@ip2location.com.


12 de agosto de 2023
I installed this because I noticed that every time I installed a new WP website, the site immediately reveived tons of visitors from a specific country's search engine before it had even gone live and I had even made my first post. On an altogether different site, it turned out that the biggest trolls were non-Americans, even though my site was US-centric. I wasn't sure whether or not this plugin would work (I keep being told that it's oh, so difficult to block countries, practically impossible), but it does seem to be working. I noticed that failed login attempts went down to zero overnight, and that most of my visitors started coming from the US. Understand, though, that this plugin isn't 100% failsafe, as bad actors can also access archives of your site from the Wayback Machine or use VPNs and proxies. But it seems to do the job so far, and I'm crossing my fingers that it'll keep working in the future.
11 de agosto de 2023
I have been using this plugin for a few WordPress applications for several years. In several of these instances, a client with a local business has requested to only have an American audience and not record any visits from international IPs. This plugin facilitates that need very well. Despite being a "free" subscriber to their service, their support has been outstanding. I had an issue several weeks ago, and their rep worked with me to resolve the issue in a reasonable amount of time. Thank you for providing such an excellent plugin and service! 🙂
3 de abril de 2023
Dear website administrators, Website owners are calling for the removal of a plugin due to the significant amount of spam it generates and its requirement for unwanted advertising in the footer of their websites. As responsible website owners, they cannot expose their users to such unethical practices, especially when it comes to online security concerns. The owners are urging developers to take immediate action and remove the plugin from the download platform to ensure the safety and well-being of their website visitors. I am writing to express my deep concern about the unethical and potentially dangerous practices that are being used by some plugins on our platform. I have noticed that some plugins are generating a significant amount of spam and require unwanted advertising to be included on users' websites in order to be used. As responsible members of the community, we must take action to ensure the safety and integrity of our websites and our visitors. We cannot allow unethical practices that compromise the privacy and security of our users. Therefore, I urge all members of the community to join me in my call to report any plugin using unethical practices. It is important that we report these incidents in reviews so that other members of the community are informed and can take action to protect their websites and their users. I hope that together we can work to ensure that our plugin platform is a safe and trustworthy place for all users. Thank you for your attention and cooperation in this critical matter I am writing to express my deep frustration and dissatisfaction with the malfunctioning of your website. As a loyal user, I have experienced multiple technical issues that have hindered my experience on your platform. In particular, I have noticed third-party developers using unethical tactics such as spam and deceptive advertising in the footer of the website. This is not only annoying, but also a security risk for users who trust your website. As a user, I am eager to see action taken against these third-party developers and strict sanctions applied to prevent future abuses. I hope that the necessary steps will be taken to address these issues and ensure that your website remains a safe and trustworthy place for users to enjoy your services without worry. Thank you for your attention to this matter and I look forward to seeing positive changes in the near future. Sincerely, Villalba Juan Manuel Pedro
7 de marzo de 2023
I think this is one of the best country blocker apps.
15 de marzo de 2023 2 respuestas
This plugin is useless as you never get the verification email that it is supposed to send out. The support from the development team is non-existant. No one answers emails. Don't waste your time trying to install this. The support people for this plugin are useless. They don't even know how to send an email! They even blocked my application to join their Facebook page! I was hoping that they could resolve my issues with their Plugin on the group. Absolutely disgusting treatment of a Wordpress user. Steer clear of these people!
Leer todas las 106 reseñas

Colaboradores y desarrolladores

«IP2Location Country Blocker» es un software de código abierto. Las siguientes personas han colaborado con este plugin.


«IP2Location Country Blocker» ha sido traducido a 5 idiomas locales. Gracias a los traductores por sus contribuciones.

Traduce «IP2Location Country Blocker» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

  • 2.23.4 Fixed undefined constant error.
  • 2.32.3 Fixed the proxy lookup issue when using IP2Location.io.
  • 2.32.2 Fixed database download issue for some users.
  • 2.32.1 Improved IP matching for IPv6.
  • 2.32.0 Added button to reset auto blacklist log.
  • 2.31.0 Added IP detection for website behind Securi firewall.
  • 2.30.2 Fixed CIDR function error.
  • 2.30.1 Improved accuracy of IP detection with CloudFlare.
  • 2.30.0 Improved IP detection for reverse proxy and CloudFlare services.
  • 2.29.2 Stop obtain client IP from custom header to prevent IP spoofing.
  • 2.29.1 Updated documentation and UI tweaks.
  • 2.28.9 Fixed undefined array key warning.
  • 2.28.8 Tested up to WordPress 6.2.
  • 2.28.7 Improve I18N Issues. (Credit: Alex Lion)
  • 2.28.6 Added source field into API web service.
  • 2.28.5 Updated to use IP2Location.io IP Geolocation API.
  • 2.28.4 Fixed error when running in wpcron.
  • 2.28.3 Updated «Requires at least» information.
  • 2.28.2 Tested up to WordPress 6.1.
  • 2.28.1 Prevent email notification when a blacklisted IP is blocked.
  • 2.28.0 Included automatic blacklist on frontend.
  • 2.27.1 Fixed typo.
  • 2.27.0 Added CIDR format supports in whitelist/blacklist. Added automatic blacklist when exceeding threshold.
  • 2.26.16 Added sorting in whitelist & blacklist. Fixed minor bugs.
  • 2.26.15 Fixed whitelist/blacklist get wiped out when inserting a reserved IP address.
  • 2.26.14 Tested up to WordPress 6.0.
  • 2.26.13 Fixed cache warning message.
  • 2.26.12 Fixed local cache storage issue.
  • 2.26.11 Further improve plugin security level.
  • 2.26.10 Migrated remote CDN scripts to host locally.
  • 2.26.9 Fixed XSS reported in https://www.exploit-db.com/exploits/50709
  • 2.26.8 Sanitized inputs to increase security level.
  • 2.26.7 Tested up to WordPress 5.9.
  • 2.26.6 Improved security against CSRF by adding nonces.
  • 2.26.5 Fixed security issues with CSRF.
  • 2.26.4 Removed missing Javascript.
  • 2.26.3 Updated default blocking template.
  • 2.26.2 Fixed header warnings.
  • 2.26.1 Fixed IP2Proxy database download.
  • 2.26.0 Performance tuning and code fixes.
  • 2.25.16 Fixed administrator notice keep showing after dismissed.
  • 2.25.15 Fixed setup issue for commercial database.
  • 2.25.14 Fixed incorrect country detected when proxy database enabled.
  • 2.25.13 Fixed library for backward compatibilities.
  • 2.25.12 Updated EU countries list.
  • 2.25.11 Fixed whitespace issue in Ajax callings.
  • 2.25.10 Use PX2 database as default for proxy lookup.
  • 2.25.9 Fixed file permission issues for some users.
  • 2.25.8 Improved manually uploaded BIN database detection.
  • 2.25.7 Removed memory restriction on IP2Proxy database download.
  • 2.25.6 Fixed missing default value on activate.
  • 2.25.5 Fixed IP2Proxy library to support PHP 7.0 and below.
  • 2.25.4 Prevent web browser from caching plugin scripts.
  • 2.25.3 Added bcmath extension checking during setup.
  • 2.25.2 Fixed setup guide issues due to memory limit when downloading IP2Proxy database.
  • 2.25.1 Fixed download issues for LITE users.
  • 2.25.0 Improved UI and added setup guide for new user.
  • 2.24.1 Tested up to WordPress 5.6.
  • 2.24.0 Added tour guide for new user.
  • 2.23.1 Updated IP2Location library to support earlier version of PHP.
  • 2.23.0 Updated file structures to use composer for IP2Location libraries.
  • 2.22.1 Minor UI update.
  • 2.22.0 Added support for blocking using proxy type.
  • 2.21.2 Fixed deactivation issue when conflicting with other plugins.
  • 2.21.1 Tested with WordPress 5.5.
  • 2.21.0 Added URL in email notification.
  • 2.20.2 Fixed warning when IP2Proxy database is not in use.
  • 2.20.1 Updated IP2Location library to support older PHP version.
  • 2.20.0 Implemented internal cache and fixed several bugs.
  • 2.19.21 Cleaned up codes and sanitized user inputs.
  • 2.19.20 Fixed variable error.
  • 2.19.19 Added attribution instructions.
  • 2.19.18 Fixed deactivation issue.
  • 2.19.17 Fixed version issue.
  • 2.19.16 Updated readme.txt.
  • 2.19.15 Tested with WordPress 5.4.
  • 2.19.14 Fixed pop out reminder not hiding.
  • 2.19.13 Fixed notification email recipient not saving.
  • 2.19.12 Increased timeout in BIN download.
  • 2.19.11 Improved UI.
  • 2.19.10 Fixed typo.
  • 2.19.9 Minor fixes.
  • 2.19.8 Added feedback request.
  • 2.19.7 Tested with WordPress 5.3.2.
  • 2.19.6 Prevented empty API key submission in settings page.
  • 2.19.5 Updated IP2Location library to 8.1.0.
  • 2.19.4 Fixed backend page detection.
  • 2.19.3 Fixed infinite redirection when using custom page.
  • 2.19.2 Removed debug message.
  • 2.19.1 Minor bugs fixed.
  • 2.19.0 Multiple features enhanced.
  • 2.18.1 Fixed minor bugs.
  • 2.18.0 Added support for dynamic admin page.
  • 2.17.6 Added FeedBurner into bot list.
  • 2.17.5 Bug fixes.
  • 2.17.4 Updated manual upload instructions.
  • 2.17.3 Fixed issue download token not saved.
  • 2.17.2 Fixed IP2Location BIN database not downloading.
  • 2.17.1 Fixed BIN database download issues.
  • 2.17.0 Migrated BIN database directory to WordPress upload directory to prevent BIN files get deleted during updates. Grouped same visitor in debugging log.
  • 2.16.0 Fixed country grouping issues.
  • 2.15.3 Updated documentation links.
  • 2.15.2 Tested up to WordPress 5.1.1.
  • 2.15.1 Fixed IP2Location API check credit interface.
  • 2.15.0 Upgraded IP2Location API to v2. Added additional checks for log table.
  • 2.14.6 Fixed database file detection in both Windows and Linux environment.
  • 2.14.5 Abort blocking when IP2Location database is missing or corrupted to prevent administrator get locked.
  • 2.14.4 BIN database no longer shipped together to prevent local copy being overwritten. Prevented IP2Location & IP2Proxy database removing each other during a database update.
  • 2.14.3 Tested with WordPress 5.0.1.
  • 2.14.2 Fixed IP detection when server forwarded wrong IP address.
  • 2.14.1 Lista de países actualizada según el standard ISO-3166 .
  • 2.14.0 Added country grouping to block several countries at once.
  • 2.13.2 Fixed database update issue.
  • 2.13.1 Minor bug fixed.
  • 2.13.0 Added option to enable/disable forwarder IP.
  • 2.12.0 Added option to purge all logs.
  • 2.11.3 Se ignora el robot de Facebook.
  • 2.11.2 Removed Facebook from bot list.
  • 2.11.1 Se arregla error en mostrar los gráficos.
  • 2.11.0 Added debug log.
  • 2.10.4 Se arregla bloqueo personalizado que no estaba funcionando correctamente.
  • 2.10.3 Fallo menor resuelto.
  • 2.10.2 Se arreglan conflictos de sintaxis cuando se usa una versión antigua de PHP.
  • 2.10.1 Cambios menores.
  • 2.10.0 IP2Location database update changed to use download token.
  • 2.9.2 Fix minor bugs.
  • 2.9.1 Separated IP2Proxy as an optional service.
  • 2.9.0 Added proxy detection using IP2Proxy.
  • 2.8.8 Minor changes.
  • 2.8.7 Actualización menor.
  • 2.8.6 Added Serbia in the country list.
  • 2.8.5 Only administrators will be listed in notification email list.
  • 2.8.4 Fixed warnings message when there is no data in statistic charts.
  • 2.8.3 Fixed charts alignment issues when viewing with smaller screen.
  • 2.8.2 Separated charts into frontend and backend.
  • 2.8.1 Fixed notice dismiss issue.
  • 2.8.0 Allow custom bots/crawlers to bypass. Supports wildcard IP address blocking.
  • 2.7.5 Fixed empty country name in statistic charts.
  • 2.7.4 Added bots detection.
  • 2.7.3 Fixed bug in logging. Updated IP2Location database.
  • 2.7.2 Fixed empty country information in notification email.
  • 2.7.1 Skip blocking if user logged in as administrator.
  • 2.7.0 Added feature to whitelist or blacklist IP. Also option to skip blocking for logged in users.
  • 2.6.7 Se corrige que la lista de baneos no puede estar vacía.
  • 2.6.6 Corrección de fallos.
  • 2.6.5 Se mejora el rendimiento de Javascript.
  • 2.6.4 Se corrigen conflictos de Javascript en interacción con otros plugins.
  • 2.6.3 Fixed typo error.
  • 2.6.2 Corrección de fallo menor.
  • 2.6.1 Se corrige el script de actualización.
  • 2.6.0 Varios cambios para mejorar la experiencia del usuario y el rendimiento.
  • 2.5.3 Fixed conflicts when multiple IP2Location plugins installed.
  • 2.5.2 Fixed Web service lookup issue.
  • 2.5.1 Fixed setting page issue.
  • 2.5.0 Use IP2Location PHP 8.0.2 library for lookup.
  • 2.4.5 Use latest IP2Location library for lookup.
  • 2.4.4 Fixed close sticky information panel issue.
  • 2.4.3 Fixed uninstall function.
  • 2.4.2 Prevent settings lost when deactivate/activate the plugin.
  • 2.4.1 Use latest IP2Location library for lookup and updated the setting page.
  • 2.4.0 Added option to disable log.
  • 2.3.9 Reverted changes to support older PHP version.
  • 2.3.8 Fixed warning message in WordPress 4.3.
  • 2.3.7 Fixed compatible issue with PHP 5.3 and earlier.
  • 2.3.6 Fixed compatible issue with PHP 5.3.
  • 2.3.5 Fixed issue when upgrading from previous version.
  • 2.3.4 Use latest IP2Location library for lookup.
  • 2.3.3 Fixed redirect issue with iOS devices.
  • 2.3.2 Fixed security issues for backend blocking.
  • 2.3.10 Tested with WordPress 4.4.
  • 2.3.1 Minor bug fixed.
  • 2.3.0 Fixed layout issue. Added warning if blocking own country.
  • 2.2.5 Fixed issue with secret code to by pass blocking.
  • 2.2.4 Fixed issue with Query IP. Prevent admin from blocking themselves in admin area.
  • 2.2.2 Fixed session issues.
  • 2.2.2 Fixed blocking failed in backend area.
  • 2.2.0 Added IP2Location web service support. Minor layout changes, and code behind rewrote.
  • 2.1.0 Added statistic to log blocked traffics.
  • 2.0.3 Fixed redirection issue that may not work if additional header information defined by other plugins.
  • 2.0.2 Updated redirection using javascript to rectify the not working issues reported under certain circumstances
  • 2.0.1 Fixed crash issue with other IP2Location plugins.
  • 2.0.0 Added IPv6 supports.
  • 1.9.2 Emergency bug fix.
  • 1.9.1 Fixed performance issues.
  • 1.9.0 Added logic to verify if the default old sample bin used for checking.
  • 1.8.0 Fixed the country display issue: South Georgia And The South Sandwich Islands
  • 1.7.0 Fixed download script errors.
  • 1.6.0 Added user details in the email alert message.
  • 1.5.0 Support secret code to bypass backend validation.
  • 1.4.0 Send email notification if an user from blocked countries was trying to access your backend page.
  • 1.3.0 Move the configuration page to settings, to alleviate the confusion of setting page location.
  • 1.2.0 Allow user to custom their own error page.
  • 1.1.0 Added dropdown selection for product code.