Restrict Map Autocomplete Field to Specific Countries
This snippet limits the location autocomplete suggestions in JetEngine map fields to only selected countries for Google Maps and OpenStreetMap providers.
Specifications
Restrict Map Autocomplete Field to Specific Countries
5 January, 2026
-
Plugin
-
Category
-
Programming languages
Installing Instruction
How to Add Snippets into the functions.php File of the Active Child Theme
- Copy the required code snippet to your clipboard.
- Navigate to WordPress Dashboard > Appearance > Theme File Editor.
- Click the functions.php tab to open the file.
- Paste the code snippet below the existing code in the Selected file content: area.
- Click the "Update File" page.
Example Use Case
Use this snippet to limit autocomplete suggestions on JetEngine map fields to selected countries only, which improves relevance and accuracy of location inputs.
Applicable scenarios:
- Regional business directories: restrict searches to supported countries.
- Travel agencies: limit destination selections for specific tours or services.
- Local event listings: ensure users pick locations only within event coverage areas.
Specifications
Restrict Map Autocomplete Field to Specific Countries
5 January, 2026
-
Plugin
-
Category
-
Programming languages