Block users by geographical location

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
Registered User
Posts: 50
Joined: Wed Apr 09, 2008 10:10 am

Block users by geographical location

Post by ilikepeach »

Is it possible to block users by their location? Can I make it so that only people from united states or Massachusetts state can access the forum?

Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: Block users by geographical location

Post by ameeck »

It is possible, but with many drawbacks.

First of all, you'd need to find a IP address range database mapping ranges to locations and then determine, if the location is correct -> not easy.

You could also pay a web service that will provide you with an API to check the same information (you don't have to manage a hundred megabyte database of IP ranges).

There will be many false calls each way -> some local users will not be able to connect and people from elsewhere could still reach your board, it's a minority of users if you set up the first step correctly, but still.

Personally, I'd discourage you from doing this. Geolocation by IP is really useful for non-critical things like advertisment targeting, but blocking access is a bit off.
Registered User
Posts: 13
Joined: Mon Dec 07, 2009 7:50 pm

Re: Block users by geographical location

Post by strikedamic »

I'd really like a mod for this. Our forum has been overrun with registrations usually from Ukrainian or Polnish IPs - sometimes even E-Mail TLDs from that area. I have already set the registration to reCaptcha (instead of the standard captcha that was in phpbb3) and that an Admin has to check, but now all three admins get around 30 or 40 hoax registration E-Mails and that's really bothering us.
Any way to accomplish this geoblock?
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: Block users by geographical location

Post by Pit$Bull »

You should start your own topic instead of hijacking a stale one.
You should be using the Q&A captcha, all others have been compromised. If you nee more info start a new topic and include the Support Request Template Generator and post it in the new topic to enable us to assist you better.
Registered User
Posts: 195
Joined: Thu Feb 28, 2008 7:46 am

Re: Block users by geographical location

Post by Slackervaara »

You can block certain countries from your site by adding blocking ip-ranges in .htaccess: ... t-formats/

Return to “[3.0.x] Support Forum”