Search Over 30,000 FREE Plugins from the Official WordPress Plugin Directory Repository

IP2Location Country Blocker

Blocks unwanted visitors from accessing your frontend (blog pages) or backend (admin area) based on country.

This plugin enables user to block unwanted visitors from accessing your frontend (blog pages) or backend (admin area) based on their countries.

Key Features

  • Allows you to block access from multiple countries.
  • Allows you to redirect users to a predefined page based on countries.
  • Default 403 error (Permission Denied) display
  • Allows you to customize your own 403 page.
  • Email alert if an user from blocked countries list is trying to access your admin page.
  • Line chart of the pages or countries blocked.
  • Supports IPv4 and IPv6

This plugin supports both IP2Location BIN data and web service for geolocation queries. If you are using the BIN data, you can update the BIN data every month by using the wizard on the settings page for the accurate result. Alternatively, you can also manually download and update the BIN data file using the below links:

BIN file download: IP2Location Commercial database | IP2Location LITE database

If you are using the web service, please visit IP2Location Web Service for details.

More Information

Please visit us at

Author IP2Location
Contributors IP2Location
Tags 403, block country, country blocker, geolocation, ip-address, ip2location, IPv4, ipv6, targeted content
  1. ip2location-country-blocker screenshot 1

    Country lookup by ip address - Allow you to perform country lookup by entering a IP address.

  2. ip2location-country-blocker screenshot 2

    Frontend blocking - Select countries that you would like to block from accessing your blog pages. Page redirection supported.

  3. ip2location-country-blocker screenshot 3

    Backend blocking - Select countries that you would like to block the visitors from accessing your admin area (wp-login) page. Page redirection supported.

  4. ip2location-country-blocker screenshot 4

    Custom error page - Custom your own error page to suit your wordpress theme.

  5. ip2location-country-blocker screenshot 5

    Email Alert - Notify you with details when an user was trying to access your admin page.

  6. ip2location-country-blocker screenshot 6

    Statistic Page - View blocked traffics and countries.

  1. Create ip2location-country-blocker folder in the /wp-content/plugins/ directory.
  2. Upload database.bin to /wp-content/ip2location-country-blocker/ directory.
  3. Activate the plugin through the 'Plugins' menu in WordPress.
  4. You can now start using IP2Location Country Blocker to block visitors.

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

  • 1.1.0 Added dropdown selection for product code.
  • 1.2.0 Allow user to custom their own error page.
  • 1.3.0 Move the configuration page to settings, to alleviate the confusion of setting page location.
  • 1.4.0 Send email notification if an user from blocked countries was trying to access your backend page.
  • 1.5.0 Support secret code to bypass backend validation.
  • 1.6.0 Added user details in the email alert message.
  • 1.7.0 Fixed download script errors.
  • 1.8.0 Fixed the country display issue: South Georgia And The South Sandwich Islands
  • 1.9.0 Added logic to verify if the default old sample bin used for checking.
  • 1.9.1 Fixed performance issues.
  • 1.9.2 Emergency bug fix.
  • 2.0.0 Added IPv6 supports.
  • 2.0.1 Fixed crash issue with other IP2Location plugins.
  • 2.0.2 Updated redirection using javascript to rectify the not working issues reported under certain circumstances
  • 2.0.3 Fixed redirection issue that may not work if additional header information defined by other plugins.
  • 2.1.0 Added statistic to log blocked traffics.
  • 2.2.0 Added IP2Location web service support. Minor layout changes, and code behind rewrote.
  • 2.2.2 Fixed session issues.
  • 2.2.2 Fixed blocking failed in backend area.
  • 2.2.4 Fixed issue with Query IP. Prevent admin from blocking themselves in admin area.
  • 2.2.5 Fixed issue with secret code to by pass blocking.
  • 2.3.0 Fixed layout issue. Added warning if blocking own country.
  • 2.3.1 Minor bug fixed.
  • 2.3.2 Fixed security issues for backend blocking.
  • 2.3.3 Fixed redirect issue with iOS devices.
  • 2.3.4 Use latest IP2Location library for lookup.
  • 2.3.5 Fixed issue when upgrading from previous version.
  • 2.3.6 Fixed compatible issue with PHP 5.3.
  • 2.3.7 Fixed compatible issue with PHP 5.3 and earlier.
  • 2.3.8 Fixed warning message in WordPress 4.3.
  • 2.3.9 Reverted changes to support older PHP version.
  • 2.3.10 Tested with WordPress 4.4.
  • 2.4.0 Added option to disable log.
  • 2.4.1 Use latest IP2Location library for lookup and updated the setting page.
  • 2.4.2 Prevent settings lost when deactivate/activate the plugin.
  • 2.4.3 Fixed uninstall function.
  • 2.4.4 Fixed close sticky information panel issue.
  • 2.4.5 Use latest IP2Location library for lookup.
  • 2.5.0 Use IP2Location PHP 8.0.2 library for lookup.
  • 2.5.1 Fixed setting page issue.
  • 2.5.2 Fixed Web service lookup issue.
  • 2.5.3 Fixed conflicts when multiple IP2Location plugins installed.

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

Yes, the plugin only provide you an outdated sample BIN file.

Where can I download the BIN file?

You can download the free LITE edition at or commercial edition at

Do I need to update the BIN file?

We encourage you to update your BIN file every month so that your plugin works with the latest IP geolocation result. The update usually be ready on the 1st week of every calendar month.

What is the frontend?

The frontend means your blog pages.

What is the backend?

The backend means the wordpress admin pages.

Can I select multiple countries for blocking?

Yes, you can.

Can I send an 403 page on blocked IP?

Yes, you can use the default 403 provided in this plugin.

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 user was trying to access my admin page?

Yes, you can configure email notification if an user from blocked countries list was trying to access your admin page.

Unable to find your answer here?

Send us email at

Version 2.5.3

Requires WordPress version: 2.0 or higher

Compatible up to: 4.7.2

Last Updated 13 Feb 2017

Date Added: 26 Nov 2013

Plugin Homepage


3.8 stars
15 ratings


Not Enough Data

Works: 0
Broken: 0