Recipe: Manage the city list

Goal

Trim or curate the cities that appear in the mobile app’s location picker. By the end of this recipe you’ll know how to hide cities you don’t serve, edit a city’s name or coordinates, and add a city that isn’t in the built-in list.


Prerequisites

  • Geofilters enabled and visible in the app per Recipe: Enable geofilters
  • WP Admin access

What you start with

Out of the box the plugin ships with 55 US cities (San Jose, Oakland, New York, Los Angeles, Chicago, Miami, Dallas, …). The full list is rendered in the mobile picker by default. You’ll typically want to:

  • Hide cities that aren’t relevant to your audience
  • Edit the lat/lon of a city if your app needs a specific neighborhood as the centroid
  • Add cities that aren’t on the default list

These three tasks happen on two different admin surfaces. The next section walks through each.


Steps

Hide cities (Geofilters tab)

The Geofilters tab is the fastest way to remove cities from the picker without losing them — they’re just hidden, and you can re-show them at any time.

  1. Go to Mobile App Manager → Geofilters.
  2. You’ll see a table with Show checkboxes next to every city. Cities currently visible to the app have a checked box.
  3. Uncheck any cities you want to hide.
  4. Click Save Changes.

On the next phone-data request the app will receive only the cities you left checked.

Where the save happens. The Geofilters tab itself is rendered by mam-geofilters, but the save handler is the generic mam_woocommerce_admin_settings_tabs_* form processor in mam-woocommerce. Hidden cities are stored in the WordPress option mam_geofilters_hidden. If you ever need to clear the list programmatically, deleting that option restores all cities.

Edit a city’s name or coordinates (Manage Cities page)

When you need to change what a city looks like — its display name, its lat/lon, or whether it’s active at all — use the Manage Cities page.

  1. Go to Mobile App Manager → Manage Cities.
  2. You’ll see an editable table with one row per city: Name, Latitude, Longitude, Active?.
  3. Edit any of the fields. Toggling Active? off has the same effect as hiding from the Geofilters tab — the entry stays in the database but is filtered out before the picker reaches the app.
  4. Click Save Changes.

The page rounds out with an empty trailing row. To add a city, fill in that row instead of editing existing rows. You can repeat — the page always renders one extra empty row.

What’s stored where. The Manage Cities page writes to the WordPress option tsl_gd_map_manager_cities. This is the canonical “what cities does this app know about” list for the top-level (city) view. Each entry has: name, lat, lon, active, plus a few fields the admin UI doesn’t currently expose (img, state, wc_prod, default).

Add a city

Two ways:

Through the admin UI (recommended): go to Mobile App Manager → Manage Cities and fill in the empty row at the bottom of the table. Save.

In code (when you want a city to ship with a custom plugin): see Hook: mam_wc_geofilters_locations for the filter signature and an example.

A few things to know either way:

  • The text (display name) is the de facto identity of a city across the admin UI. Don’t reuse a name that already exists; the show/hide checkbox UI keys on it.
  • Entries with lat == 0 or lon == 0 are silently dropped from the mobile payload. If you’ve added a city and it’s not appearing, check that the coordinates are non-zero.

Verification

Make sure the result is what you wanted before signing off:

  1. Open the mobile app and open the location picker.
  2. Confirm hidden cities are absent.
  3. Confirm any cities you renamed appear with the new name.
  4. Confirm any cities you added appear and select correctly (the app should refresh the home view to show content near that city).
  5. If something’s off, re-check the Active? column on the Manage Cities page and the Show checkboxes on the Geofilters tab — a city has to be both active and not hidden to appear.

This article was last verified against:

  • Plugin: mam-geofilters v2.1.1
  • WP options: mam_geofilters_hidden, tsl_gd_map_manager_cities

Re-verify whenever the Manage Cities admin page columns change, the option keys above are renamed, or the silent zero-coordinate drop in mam_geofilters_list::add_geofilters() is removed or changed.


  • Plugin overview: mam-geofilters
  • Recipe: Enable geofilters
  • Recipe: Per-neighborhood city lists
  • Hook: mam_wc_geofilters_locations
  • Hook: mam_geofilter_list

Metadata

Field Value
Article type Recipe (Admin)
Plugin slug mam-geofilters
Applies to plugin version 2.1.1+
Category Building Your App
Audience WordPress admin
Estimated time 10 minutes
Prerequisites article Recipe: Enable geofilters
Last verified 2026-04-30
Contents

    Need Support?

    Can’t find the answer you’re looking for? Don’t worry we’re here to help!