Getting an API key
You can get a Google Maps API by following our instructions here (make sure it’s not restricted to domain)
How to verify if Geocoding is working?
- First make sure you key is properly created (not restricted to domain). Open following link and add your API key at the end of URL: https://maps.google.com/maps/api/geocode/json?address=%22New%20York%22&key=ADD_YOUR_API_KEY_HERE
- Then create a new job listing with a location name, view the job listing in wp-admin. It should contain the location details in custom fields. For example:
When are API calls made?
Calls to the Google API are made when:
- A job is submitted.
- The location of a job is changed.
- Jobs are imported (using WP All Import) that have location data.
Geolocation data for a particular location is cached for 1 week, so an API call is not necessarily made every time in the above instances.
Geolocation Info and Custom Fields settings
Please note that to view what is saved as geolocation data in WP Jb Manager from the backend of your site, you need to enable the Custom Fields option in the WordPress Admin for the job post type.
You can do it by doing the following:
- Head to your job listing post
- Click on the three vertical dots at the far right of the screen (the settings option)
- Click on
- Select the
Additional, toggle on the Custom Fields option.
Here’s a screencast to guide you through it (the short video will be downloaded upon clicking on the link below):
Is this optional?
The API key is required if you want your job listings to contain geolocation data. Without the key, the location entered in the Location field when submitting a job will be stored as a single text string in the _job_location custom field.