Recipe: Enable geofilters

Goal

Turn on the location picker in your mobile app, choose how it appears (inline or as an icon), and set the default search radius. After this recipe, users who open the app for a configured role will see a geofilter picker and the app will return content within the chosen radius of the chosen city.


Prerequisites

  • WordPress admin access
  • MAM Suite installed, with mam-main and mam-geofilters activated under Mobile App Manager → Software
  • At least one configured user role (e.g., mam-all or a custom MAM role)

If mam-geofilters is not installed, see Plugin overview: mam-geofilters for installation steps.


How the on/off decision works

mam-geofilters looks at two per-role settings to decide whether to show the picker:

Setting Effect when yes
tsl-use_geofilters Show the picker inline in the home view
tsl-geofilters_show_as_icon Show the picker as a compact icon in the navigation chrome

The picker appears if either setting is yes. The two settings are not mutually exclusive — turning both on enables the icon presentation.

A third setting, tsl-setting-geofilter_radius, controls the default search radius in miles for the role. The mobile app can also send a per-request override.

All three settings are stored per role, so different roles can see different behavior in the same app.


Steps

1. Open the role’s settings

Go to Mobile App Manager → App Settings. Pick the role you want to configure (for most apps, start with mam-all). Open the General Settings tab.

2. Enable the picker

Set Use Geofilters (tsl-use_geofilters) to yes for an inline picker.

If you’d rather show the picker as an icon, set Show Geofilters as Icon (tsl-geofilters_show_as_icon) to yes instead.

You may set both — the app will use the icon presentation in that case.

3. Set the default radius

In the same tab, set Geofilter Radius (tsl-setting-geofilter_radius) to a value in miles. Typical defaults:

  • Tight regional app: 2550
  • Statewide app: 100250
  • National app: 500+

If you leave the field empty, the plugin uses 25 miles. The hard cap is 3000 miles.

Save the role.

4. Verify

Open the mobile app for a user in the role. You should see:

  • A location picker (inline or icon, per your choice)
  • The default city’s content within the radius you set
  • A “Current Location” entry at the top of the picker if GPS is enabled on the device

If the picker doesn’t appear, double-check that you saved on the right role and that the app is signed in as a user in that role.


Variations

Override the on/off decision in code

If you need the on/off decision to depend on something the role-settings UI can’t express — a feature flag, a query parameter, a custom user meta — use Hook: mam_force_geofilters to override the resolved value.

Override the radius in code

To bump or tighten the radius programmatically (e.g., wider for premium users, narrower for free users), use Hook: mam_geofilter_radius.

Trim the city list

To hide cities you don’t serve, see Recipe: Manage the city list.


Verification

This article was last verified against:

  • Plugin: mam-geofilters v2.1.1
  • mam-main (provides the App Settings UI)

Re-verify whenever the per-role settings UI changes, the names of tsl-use_geofilters / tsl-geofilters_show_as_icon / tsl-setting-geofilter_radius change, or the default radius value changes.


  • Plugin overview: mam-geofilters
  • Recipe: Manage the city list
  • Recipe: Per-neighborhood city lists
  • Hook: mam_force_geofilters
  • Hook: mam_geofilter_radius

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 5 minutes
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!