Skip to main content

Locations and Addresses

Compatibility
This feature compatible with Better Messages 3.3.0 or higher

Better Messages shows an administrator where a guest or a member connects from: the country, the city and the addresses (IP addresses) of their last connections. The location is found on the site itself. No address is sent to a service to look it up.

It is a tool for moderation. A guest who signs up again under another name shows the same address, and an address used by several people names them all.

What it adds#

Where a location comes from#

An address alone says nothing about a place. Better Messages asks three sources in this order, and the first that knows the answer wins.

SourceWhat it givesWhen it is used
CloudflareThe country, and the city where the visitor location headers of Cloudflare are onThe site is behind Cloudflare. The headers are believed only on a request that really came from Cloudflare
The DB-IP databaseThe country, or the country and the cityA database is chosen in the settings and downloaded to the site
WooCommerceThe countryWooCommerce is active with its own location database set up

Where Cloudflare gives the country alone, the database adds the city.

With none of the three, addresses are still kept and shown, with no country and no city beside them.

Setting it up#

Navigate to WP Admin → Better Messages → Settings → Integrations → Locations.

Settings, Integrations, Locations. The Locations card with the Database choice of None, Countries only (about 8 MB) and Countries and cities (about 120 MB), the Status row that says In use: 2026-11, 121 MB with the Download again button, the Other sources lines, the Keep addresses switch, Keep addresses for 90 days, the Flags in online lists switch and the credit of DB-IP. Under it the card In Better Messages with the places that show a location
SettingWhat it doesDefault
DatabaseNone, Countries only (about 8 MB on the site) or Countries and cities (about 120 MB on the site). The download itself is about half of that, as the file comes packed. Nothing is downloaded when you choose one or save itNone
StatusShown once a database is chosen. Not saved yet until the choice is saved, then Not downloaded yet with the Download button, Downloading… while it comes, and In use with the month of the database and its size, where Download again takes it again at once—
Other sourcesSays whether Cloudflare is detected and what it provides, and whether WooCommerce provides the country—
Your locationYour own location as the site finds it, a quick check that it works—
Keep addressesStores the last 20 addresses of each guest and member. Turning it off deletes every stored address when the settings are savedOn for a new site. Off on a site updated from a version before 3.3.0, where no address is stored until you turn it on
Keep addresses forThe number of days an address is kept, from 1 to 365090 days
Flags in online listsShows the flag of the country beside each person in the lists of who is onlineOff

Nothing on this screen is saved until you press Save Settings, which shows at the foot of the page as soon as something is changed. Saving with Keep addresses turned off asks first, as it deletes every stored address and cannot be undone.

The card In Better Messages under the panel lists the screens that show a location, with a link to the list of guests.

The database#

The database is one of the free databases of DB-IP, which DB-IP publishes under the Creative Commons Attribution 4.0 licence.

  • Nothing is downloaded by choosing a database. Save the choice with Save Settings, then press Download to start the first download
  • It is downloaded into wp-content/uploads/wordplus/geo/ on your own site
  • Once a database was downloaded, a background task takes the new one each month. It is never downloaded during the request of a visitor
  • Choosing the other kind keeps the database in use until the new one is downloaded
  • A new file replaces the old one only after it was read back and answered correctly, so a broken download leaves the site with the database it had
  • None deletes the files
  • Every WordPlus plugin on the site uses the same copy

If the download fails, the panel says why: the uploads folder is not writable, the zlib extension of PHP that unpacks the file is missing, or the file could not be downloaded or read.

Where an administrator sees it#

In the screens of Better Messages, an administrator is anyone who may open Administration: the administrators of the site and the roles chosen at Settings → Moderation → Reports and Holds → Roles That Can Access Administration. The two columns of the Users list of WordPress are shown to administrators of the site alone.

Administration → Guests#

Navigate to WP Admin → Better Messages → Administration → Guests. The list has a Location column, with the flag, the city and the country, and a Last address column.

Administration, Guests: a table of guests with their id, name and photo, email and whether it is confirmed, location with a flag, last address, last active time and the numbers of messages and conversations

Press a row to open Guest Info. Its Addresses table lists every address kept of the guest:

ColumnWhat it shows
AddressThe IP address
LocationThe flag, the city and the country, where they are known
Last seenThe last time the guest connected from it
Also used byThe other guests and members seen on the same address
The Guest Info popup of a guest: the name and photo, the email and its state, when the guest signed up and was last active, and the table of addresses with their location and dates

The popup also shows the IP Address at sign-up, which is kept with the guest. While no address was kept yet, the list shows that one as the last address.

Administration → Messages#

Navigate to WP Admin → Better Messages → Administration → Messages. Under the number and the time of each message, the list shows where its sender last connected from: the flag, the city and the country, and the IP address. It is there for guests and for members.

Administration, Messages: three messages of one conversation. Under the first, ringed in red, the flag of Germany, Berlin, Germany and the IP address of the guest who sent it. The message of the member shows Amsterdam, Netherlands and their address
  • It is the last address of the sender, not the address a message was sent from. Better Messages keeps addresses with the person, not with each message
  • The date it was last seen shows when the pointer rests on the line
  • A sender with no address kept has no such line

The details of a conversation#

In a conversation of two, the information panel of the messenger shows an administrator a Details block about the other person, a guest or a member.

The information panel of a conversation with a guest, as an administrator sees it. The Details block, ringed in red, shows the Location with a flag, the Last address with its date, the Email and its state, when the guest registered, and the note Visible to administrators only
RowWhat it shows
LocationThe flag, the city and the country, where they are known
Last addressThe IP address and when it was last seen
EmailFor a guest: the email and whether it is confirmed, not confirmed or from a booking
RegisteredWhen the person registered or signed up
Agreed to the termsFor a guest: when they ticked the consent checkbox of the sign-up form

The block ends with Visible to administrators only. A member who is not an administrator never sees it, and the site does not send them its content. Group conversations and chat rooms have no such block, and neither has the mobile app.

The user screens of WordPress#

For members, WordPress itself shows the same in two places.

The Users list gets two columns, Location and Last address.

The screen of a user (Users → Edit) has it in its Better Messages section, under the numbers of messages and conversations of the user:

The Better Messages section of the Edit User screen of WordPress for a member: Messages Sent, Conversations, then, ringed in red, Location with a flag and Amsterdam, Netherlands, Last address with the IP address and when it was last seen, and the Addresses table with the address, its location, when it was first and last seen and who else used it
RowWhat it shows
LocationThe flag, the city and the country of the last address
Last addressThe IP address and when it was last seen
AddressesEvery address kept of the user: the address, its location, when it was first and last seen, and who else used it

The section is shown to anyone who may open Administration. The rows are there once an address of the user was kept, while Keep addresses is on.

Flags in the online lists#

Turn Flags in online lists on to show the flag of the country beside each person in the lists of who is online: the online list of a chat room, and the Friends, Users and Online lists and the search results of the messenger.

  • Everyone who sees the list sees the flag, guests included
  • Only the flag is shown. The city and the address are never sent to anyone but an administrator
  • The name of the country shows when the pointer rests on the flag
  • A person whose country is not known has no flag

It is off by default.

What is kept, and for how long#

  • Up to 20 addresses per person. Each with its country, region and city, the first and the last time it was seen, and how many times
  • At most one write an hour for a person and an address. An address is noted when the messenger of a member or a guest talks to the site, and when a member logs in. Opening a page alone notes nothing
  • 90 days, or the number of days you set. A daily background task deletes what is older
  • Keep addresses off deletes every stored address once the settings are saved and the question is confirmed, and nothing is noted while it is off
  • Deleting a member or a guest deletes their addresses
  • The address at sign-up of a guest is kept with the guest, as it was before 3.3
  • With Stored Data Encryption on (Settings → Messaging), the addresses and their locations are stored sealed

Addresses are personal data. While Keep addresses is on, Better Messages adds a paragraph Addresses and locations to the privacy policy text WordPress suggests at Settings → Privacy, which says what is kept, for how long and who sees it.

The personal data tools of WordPress cover the addresses of a member: Tools → Export Personal Data lists each address with its country, region, city and the first and last time it was seen, and Tools → Erase Personal Data removes them. Both tools find a person by the email of a user account, so they do not reach guests: the addresses of a guest leave the site when their days are over, when Keep addresses is turned off, or when the guest is deleted.

Frequently asked questions#

Is any address sent to another company?#

No. The location is read from a file on your own site, or from what Cloudflare already sent with the request. The only request the feature makes is the monthly download of the database from DB-IP, which carries nothing about a visitor.

How exact is the location?#

The country is right in almost every case. The city is the best guess of the database and can be a neighbouring city. A person on a VPN or a mobile network shows the place of that network.

The site is behind Cloudflare. Do I need the database?#

Not for the country. For the city, either turn the visitor location headers on in Cloudflare or choose Countries and cities here.

Can members see where other members are?#

No. The location and the addresses are for administrators. The only thing others can see is the flag, and only after Flags in online lists is turned on.

Does it slow the site down?#

A lookup reads a local file, and an address is written at most once an hour for each person.

What happens to the addresses when I turn it off?#

Turning Keep addresses off and saving deletes every stored address. The page asks you to confirm it first, as it cannot be undone. Choosing None as the database deletes the database files, and new addresses are then kept with no location.

For developers#

A person is a user id: a member is a positive id, a guest a negative one.

// The place of an address: country, region, city and the source that knew it.
$place = wordplus_geo()->locate( '203.0.113.7' );

// The addresses kept of a person, newest first, and the last one.
$addresses = wordplus_addresses()->of( $user_id );
$last = wordplus_addresses()->last( $user_id );
  • wordplus_geo_locate answers a lookup yourself: return an array with country, region and city for an address
  • wordplus_addresses_can_view decides who sees the addresses in the user screens of WordPress
  • wordplus_geo_can_manage decides who may change the Locations panel
  • wordplus_trusted_proxies lists the proxies in front of the site, so the address of the visitor is read and not the address of the proxy

See also#