1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Autocomplete Location 1.0.1

Autocomplete for the location field

  1. Thomas.B
    Compatible XF Versions:
    • 1.4
    • 1.5
    Updates Duration:
    Visible Branding:
    This add-ons makes it super easy for your members to state their location (city, state or country). Often the right location is already shown on the autocomplete list after the user entered only 3 to 4 letters. The webservice that this add-on uses to search locations has access to almost 10 million names of populated places. Also if you want to prevent nonsense locations such as „right behind you“, you can optionally force users to pick a location from the autocomplete list. Furthermore, the list uses XenForo CSS. So the list will seamlessly integrate with your (custom) style as you can see on the following image:


    Another major feature of this add-on is that it can save (atomic) location data of the selected location in separate custom user fields. This atomic data is then e.g. used to create shortened location names for the user info besides a post as you can see on the following image:


    Note that state codes are only available for a limited number of countries. The state codes are derived from the corresponding ISO 3166-2 codes. These codes are included in the add-on as they cannot be accessed through the Geonames webservice.

    Live Demo

    You can try this add-on on the sign-up page of my website. Note, that I configured the add-on to use English location names. Also the add-on uses the Geonames premium webservice (see below for more info).

    About Geonames

    Geonames is a free global geographical database that contains over 10 million place names. Geonames is over 10 years old and has become very popular. It is also used by „global players“ such as Microsoft, Nokia and Adidas. Besides the actual database there is also a web service that third-party products such as this add-on can use to easily access the location data. Please note that this add-on uses the free web service by default. Have a look at the following comparion for the differences between free and premium servers.

    Free and Premium Servers


    Hint: The statistics are derived from my own data that was gathered between 1st January and 7th March 2016 with a frequency of 1 request per minute for each server type. On request I'm happy to provide any kind of statistics (if possible). Just let me know what exactly you would like to know..

    The „Availability“ represents the percentage of successful requests. A request is considered as „unsuccessful“ if it took longer than 2500 milliseconds or if the server replied with an error. Note that, 2.5 seconds may seem not very much. However, in a realtime context such as an autocomplete list where a very high responsiveness is desirable, it is actually a very long time.

    „Average processing time“
    This number is the average time needed by a Geonames server to successfully process a request. The lower the processing time, the faster the autocomplete lists updates.

    „Server locations“
    The farther your server (if ACL is in „server mode“) or your user (if ACL is in „client mode“) is away from the Geonames server, the longer it takes to send and receive requests. Note that this is independent of the processing time.

    „HTTPS support“
    As you can see on the above comparison the free servers do not support secure sites (HTTPS). Fortunately you can still use this add-on on secure sites with free servers if you set the „Geonames caller“ to „Server“. However, in this case the autocomplete list will update somewhat slower as the Geoname requests will have to make detour(s) through your server.

    Access to premium servers

    If you would like to use the premium servers you can purchase the required credits directly from Geonames. However, as even the cheapest „credits package“ is pretty expensive (40 EUR/year) I decided to offer a considerably cheaper access to the Geonames premium servers exclusively for customers of this add-on. For more information please have a look at my Geonames Premium Access forum.

    My recommendation

    If you are going to use this add-on as an optional usability improvement, then the free servers are probably sufficient. Users will then also be able to enter a location even if the autocomplete list updates very slowly or not at all. However, if you configure the add-on so that users will have to select a location from the autocomplete list, I strongly recommend to use the premium servers, especially if the location field is a required field on the sign-up page.

    Location fields support

    Currently this add-on supports the location field of the regular registration and the Personal Details page. Support for registration through external sites is planned for future releases.


    The „usual procedure“. For your convenience, you may use the Add-on Install & Upgrade add-on.

    Privacy notice

    If you use this add-on with one of my Geonames Premium Access plans, each request to the Geonames service will be tracked by my server. The following information will be transfered:
    • the page type from which the request originated („Registration“ or „Personal Details“ page)
    • the anonymized IP address of the user that caused the request
    Note that „anonymized“ means that only the first three parts of the IP address are unchanged. For example, anonymized version of the address would be
    Related Resources:
    Member Search


    1. options-beta7.png
    2. user_profile_location_string.png
    3. customFieldsACP-b6.png
    worrorfight and Veer like this.

Recent Updates

  1. A small bugfix
  2. One small fix
  3. Fixed issues with mobile devices

Recent Reviews

  1. Axel B
    Axel B
    Version: 1.0.0-b1
    Excellent addon with great support! Does what it says on the tin. I cannot get the Services_Geonames PEAR package on a shared server, but that does not impact the core functionality I need. Highly recommended addon. Grab it while you can get the discount :P
    1. Thomas.B
      Author's Response
      Thanks for the review! I'm glad you like it :)