Discourse User Location

User Location plugin

Inspired by X About this Account, this plugin shows the country of registration and the country of login on user card and user profile.

:information_source: Summary shows the country of registration and the country of login on user card and user profile
:hammer_and_wrench: Repository Link https://github.com/communiteq/discourse-user-location
:open_book: Install Guide How to install plugins in Discourse
:money_bag: Sponsored by This plugin was kindly sponsored by @WorldIsMine

Features

  • Automatic Detection: Uses Discourse’s built-in IP lookup (MaxMind) to determine countries.
  • Dual Display: Shows both “Registered In” (based on registration IP) and “Located In” (based on most recent IP).
  • Smart Caching: Caches location data in a custom field to prevent constant IP lookups and latency. It only updates when the user’s IP address changes.
  • Privacy Controls: Allows admins to exempt specific user groups (e.g., Admins, Moderators) from having their location displayed.

Screenshots

User Card

User Profile

Settings

Name Description
user_location_enabled Enable or disable the plugin globally.
user_location_exempt_groups A list of groups whose members will not have their location displayed.
4 Likes

Really neat plugin! I’m just wondering, is there a way for a user to opt out of this, besides making their profile private?

2 Likes

The basic idea is that this can be used for fraud prevention, so users are not supposed to opt out.

However, what does work is:

  • create a group “location opt out” which users can freely join
  • add this group to the user_location_exempt_groups setting
4 Likes

1 Like

Super useful for my francophone community, where the French tend to forget the language is spoken outside their country, and the Quebec members each think they are the only one from Quebec, and knowing what country people live is super precious information regarding what veterinary facilities they will have at hand!

5 Likes

Very cool. Pairs nicely with Country flags as well

1 Like