Nearest Locations
Add factual local content and real distances to matching landing pages without a remote request during rendering
What It Does
Nearest Locations matches a landing page's slug, resolves the named place in the background, and appends the closest active locations with real straight-line distances. The HTML is rendered on the server, so search engines and page caches receive stable page-specific content.
Configure Page Rules
- Enable Add nearest locations to matching pages.
- Click Add Rule.
- Enter one safe wildcard pattern and the post types it can match.
- Choose distance units, an optional venue label, and optional CTA text and URL.
- Save settings, then click Run Geocoding.
service-in-* matches service-in-walsall
branch-* matches branch-birminghamPatterns accept lowercase letters, numbers, hyphens, and at most one *. Raw regular expressions are not accepted.
Background Geocoding
The default postcodes_io provider resolves Great Britain place names in bounded background batches. Successful results and confirmed misses are cached; transport errors are retried after backoff.
Use Retry Misses after correcting a rule or changing provider. Use Clear Cache only when all resolved places need rebuilding.
prorank_nearest_locations_geocoder or manual per-post coordinates.Optional Device Location
Enable Offer a "Use my location" button to add a progressive enhancement for visitors. The search-engine-facing block remains unchanged.
- The browser asks for permission only after the visitor clicks.
- The visitor's coordinates never leave the browser.
- Distance calculations use the public coordinates of your active locations.
- Denied, timeout, unavailable, and unsupported states are announced accessibly.
WP-CLI
wp prorank nearest status
wp prorank nearest geocode --limit=100
wp prorank nearest set-place 123 --lat=52.5862 --lon=-2.1288 --name='Wolverhampton'
wp prorank nearest flush-cache --misses-onlyTroubleshooting
- No block appears: confirm the feature is enabled, the post type and slug match a rule, and at least one active location has valid coordinates.
- A place remains unresolved: check the status counters, then retry misses or provide manual coordinates.
- Wrong place selected: clear the affected cache entry and use manual coordinates when a name is genuinely ambiguous.
- Device button is absent: enable the device-location toggle and clear page/CDN caches.