0

I have a pharmacist client who makes compounds but can only service customers in Georgia. He gets a lot of calls from out of state people, is there a simple way to block people from out of state from even seeing his wordpress site?

Thank you for any feedback.

I tried googling this, and found some forum posts. They mostly said it's very hard if not impossible to do. However, most of the posts I saw were around ten years old, so I was wondering if that info is still correct.

  • One of these, or search for similar? https://stackoverflow.com/questions/4937517/ip-to-location-using-javascript or https://stackoverflow.com/questions/70707110/is-it-possible-to-find-device-geo-location-based-on-ip-address-using-nodejs or https://stackoverflow.com/questions/68807152/is-it-true-that-the-location-gotten-by-javascript-is-more-accurate-than-the-loca – Dave S Aug 23 '23 at 23:37

1 Answers1

0

To answer your question, yes this is possible. It is normally done by using a Geo IP database, which is a database of IP addresses to location. These databases can be tied into your hosting software- for example, nginx has some documentation on how to do this.

One of the problems you'll run into though is that web crawlers, such as the ones for Google, are likely to get blocked by this unless you manage to add explicit exemptions (which is less than trivial, since their ip blocks can change). As a result if you do this you can expect the site to disappear from most search engines.

Robert Hafner
  • 3,364
  • 18
  • 23