WpRentals offers three ways to set / search property locations:
- Google or OpenStreet Places Autocomplete
- Theme auto save location based on saved property location details
- A dropdown selector
In this guide we will explain how to manage the listing location with Google Places or OpenStreet Places
To use Google places, you must add a Google API key (and make sure the Places library is enabled for that key).
Configuring Google or OpenStreet Autocomplete
1. Enable Autocomplete
- Navigate to Admin > WpRentals Options.
- Go to Search > Location Field Search Settings
- Enable the option to Use Google Places or Open Street Places for Location Field in Search? (set YES)
- Disable the option Use Dropdowns for Cities and Areas in Submission Form? (Set NO)
- Click Save Changes.
Optional: Limit Limit Use Google Places or Open Street Places to a specific country?
2. Set the Map System
- Go to Admin > WpRentals Options > Map Configuration > Map General Settings
- Choose What Map System do you want to use? and Select Google Maps or OpenStreetMaps.
- If using Google Maps:
- Generate a Google Maps API Key. Click to see the help for how to generate a google api key.
- Enable Google Places.
- If using What Map System do you want to use? -> OpenStreet
- Enable OpenStreet Places.
- Click Save Changes.
3. Configure Submission Form Settings
- Navigate to Admin > WpRentals Options > Search > Location Field Search Settings
- Disable the option Use Dropdowns for Cities and Areas in Submission Form? (Set NO)
Why: For location to be saved correctly with Google Places or Open Street Places it needs to be selected and searched with the same system.
Using Google or OpenStreet Autocomplete in Submission Form
- Go to User Dashboard > Add New Listing.
- Fill in the mandatory fields.
- In the City field, start typing a city name.
- A dropdown will appear with suggestions from Google or OpenStreet.
- Select a city from the dropdown.
- The Country field and other location details will be automatically populated based on the selected city.
- Complete the remaining listing details and publish the listing.
Searching for Listings Using Google or OpenStreet Autocomplete
- Go to the Homepage.
- Enter a location (e.g., New York) in the Search Field.
- Select the matching result from the dropdown.
- Click Search.
- The listing that matches the selected location will appear in the search results.
Configuring Search Form with the location field
The settings for Auto-Complete with Google Places or OpenStreet Places will apply to all search forms that support location.
The following search forms are available in the WpRentals theme, and you may use them in any setup you wish with the Location Field search:
Hero Media Search (available in 5 variations). More here
- Type 1 – Default Search (hardcoded)
- Type 2 – Default Search (hardcoded)
- Type 3 – Supports Custom Fields only
- Type 4 – Default Fields (Hardcoded) + Custom Fields
- Type 5 – Supports Custom Fields only
Each of these variations may show as
- Mobile Search
- Search Shortcode
- Search Widget
Half Map Layout Search. More here
- This form is configured exclusively with Custom Fields.
Search Form Builder in Elementor. More here
- This form is configured exclusively with Custom Fields.
In these search forms, the location field can appear as:
- Default Field (“Where do you want to go?”)
Custom Field (“Location”)
Elementor Search Form Builder Field – Location