Tag Archives: geolocation

Detect visitor's country from his IP address in your WordPress plugin or theme

GeolocationRecently while coding my "who is online" WordPress plugin Quick Count I had an idea that it would be great if I could somehow detect visitor's country of origin from his IP address. After doing some research I've learned that most online IP to country services are proprietary and offer limited services for free or they don't offer free service at all. Then I came across a great ip-countryside open source project by Markus Goldstein. He has developed open source C++ application that creates IP to country database using 5 Regional Internet Registries (RIR): AFRINIC, APNIC, ARIN, LACNIC and RIPE. I've decided to create open source WordPress plugin named Quick Flag that uses this database to provide IP to country services to all WordPress community. In this article I'll show you how to install and use Quick Flag IP to country functionality from your own plugin or theme.

Continue reading