Skip to content

Troubleshooting

A search returns no listings

Almost always this means the listings have no coordinates. A listing only becomes searchable by distance once all of these are true:

  1. Its location category has Is Location and Use for Radius Search both on.
  2. The term it's assigned to (its city/region/lot) has Latitude and Longitude filled in.
  3. The listing has been saved since 1 and 2 were done.

Work through Settings. Editing a term's coordinates or the category toggle re-syncs listings automatically in the background; to force it, run:

wp dms-radius sync

Confirming with the debug log

Add to wp-config.php:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'DMS_RADIUS_DEBUG', true );

Run a search and check wp-content/debug.log. A line like:

[dms-radius] radius filter {"origin":{...},"distance":100,"listings_with_coords":0,"matched":0}

listings_with_coords: 0 confirms no listing has coordinates yet. Re-save a listing and look for [dms-radius] sync: wrote coords. If you instead see sync: matched radius category but term has no lat/lng, the term is missing its coordinates.

I moved a term's pin but distances didn't change

Editing a location term's latitude/longitude schedules a background re-sync of every listing on that term. It runs on wp-cron, usually within a minute of the next site visit. If cron is disabled, or you can't wait, run:

wp dms-radius sync --type=<slug>

The "Near me" button does nothing or shows an error

  • The page must be https://. Browsers block location access on insecure pages. The button reports the location as unavailable.
  • Permission denied. The visitor (or their browser settings) declined the location prompt. They can still type a ZIP or postal code.
  • A privacy extension or corporate network can block geolocation entirely.

Choosing "Distance" in the sort does nothing

Distance sorting needs a location to measure from. If the visitor hasn't entered a ZIP or used Near me, choosing Distance prompts them for their browser location first. If they decline, the sort can't apply and the previous order is kept.

Canadian postal codes are imprecise

The full Canadian postal code table (~900,000 codes) downloads automatically in the background the first time an administrator opens the WordPress admin after install. Until it finishes, Canadian searches resolve to FSA level — the first three characters — which is accurate to a few kilometres.

To force it now, run:

wp dms-radius import-postal

To skip the download entirely and stay at FSA level, add to wp-config.php:

define( 'DMS_RADIUS_SKIP_CA_FULL', true );

The download needs outbound HTTPS to geonames.org and the PHP zip extension. If either is unavailable the FSA table still works.

A ZIP or postal code isn't found

If a code isn't in the built-in table the extension falls back to a public lookup service, which is rate limited. A code that is genuinely invalid, or a partial one, won't resolve and the filter is ignored for that request.

The distance shortcode always shows the button

[dms_get_distance] shows Calculate distance until a location is known. If tapping it does nothing, check the page is https://. If it shows nothing at all, that listing has no coordinates — see the first section.

The unit toggle and the distance dropdown disagree

This is almost always a stale script cache: the page markup updated but the minified JavaScript did not. Add define( 'DMS_DEBUG', true ); to wp-config.php to load the unminified scripts, or clear your site and CDN caches, then hard-reload.

The Radius Search tab is missing

Confirm the extension is active in DMS → Extensions and that your license is Standard or higher. The tab is at Listing Type → Settings → Radius Search.