• We've added extra Spam Protection. if you get problem with account registration / registration rejected. please contact us
Ali Raza

GeoIP + GDPR Geoblocking 3.0.2

No permission to download
This XenForo 2.0 addon provides GeoIP and GDPR Geoblocking using Maxmind's GeoIP2 Precision service. It also displays the country associated with any IP address visible to administrators throughout the XenForo UI.

The primary function of this addon is to provide anti-spam services by blocking users from certain countries being able to register. You might also use this to automatically approve registrations from certain countries while forcing registrations from other countries to be moderated.

For example, my PropertyChat website primarily services an Australian audience, so I allow users from Australia (and New Zealand) to register directly, while registrations from all other countries are placed into moderation. There are also a few countries which are the source of the bulk of spam posts I receive and are thus completely blocked from registering.

Requires a paid subscription to Maxmind's GeoIP2 Precision: Country

General usage:

When a user registers, after all spam checks are complete - the IP address they are using will be checked against the GeoIP web service to determine the country they are in.

You may set up a list of "approved" country codes (using 2 character ISO codes) which will always be approved, as well as a list of "denied" country codes, which can be set to automatically reject registrations (or to place them in moderation for admin approval).

You may also choose to have registrations from any country not in either list, placed in moderation.

Typical usage is to set a list of approved countries, a list of denied countries (with registration rejected) and then have everyone else moderated so you can manually approve them. This model has worked well for me for over 3 years in my (unreleased) v1.x XF addon and quite a few years previously on vBulletin.

The ISO country code associated with each IP address is cached in the database to improve performance and avoid excess usage fees.

The message a user will receive when their registration is rejected is "Your registration has been rejected by our automated anti-spambot system. Please contact the administrator for further information or assistance."

GDPR block:

A "Reject EU Registrations" option can be enabled to automatically block registrations from any countries within the European Union, which may help minimise risk for sites which are not serving EU members and do not intend to implement GDPR support. Note that existing registered users will be unaffected by this setting - it only applies at registration.

This option will be over-ridden by Approved and Denied lists, which can be useful for cases such as the UK, where they are technically still part of the EU until Brexit occurs, so by adding "GB" to the Approved list, you can avoid blocking people from the UK while blocking everyone else in Europe.

Of course, users can always use a proxy server to get around these blocks - but at least you've made a concerted effort to block EU members - which is all you can do.

The message a user will receive when their registration is rejected because of the EU block is "Your registration has been rejected because we do not allow people from the European Union to use our site. Please contact the administrator for further information or assistance."

Configuration screen:


Lookup test:

Perform a web service lookup and show the country code for the IP address (blur added for screenshot only)


Configuration tester:

Does not perform any web service lookups - simply tests the entered ISO code against your configuration and optionally simulates what would happen if that country was in the EU.


IP address display examples:

(Blur added for screenshots only)

Members list:


IP address information:

User IP addresses:

Users logged at IP:
Ali Raza
First release
Last update
4.00 star(s) 1 ratings

More resources from Ali Raza

Latest updates

  1. v3.0.2 bug fix

    handle missing iso codes for anonymous proxies and missing data Note that you cannot directly...
  2. v3.0.1 bug fix

    be more graceful in failure when api isn't yet configured Note that you cannot directly upgrade...
  3. Bugfix

    bugfix: static function GeoIP\Util\IpGeo::isConfigured wasn't defined as static