1. Description
  2. Usage
  3. Changelog
  4. Source File
  5. Related


This filter enables you to modify the parameters included in the geocode component filter.

If you, for example, search for Springfield, then the first result the Geocode API returns is located in Massachusetts. Which is fine if your store is actually located in Massachusetts, but if it’s located in Illinois, then the only thing the user will see is a “No results found” message.

To fix this you can use this filter to restrict the results by administrativeArea, country, locality, postalCode and route.

This only works if a default map region is selected on the settings page, and the “Restrict the geocoding results to the selected map region?” checkbox that shows up after selecting a map region is enabled as well.


This example restricts the returned geocode results to Illinois:


Since 2.1

Source File

This filter is located in /frontend/class-frontend.php


The code needs to be placed in the functions.php file inside your active theme folder.