Documentation

Geocoding with Google’s Maps API

Last updated on

In Job Listings > Settings, you’ll find a field to enter your Google Maps API Key.

When you enter your Google Maps API Key there, WP Job Manager will retrieve location information from Google Maps based on what’s entered into the location field when a job is submitted.

This is used to provide structured data for better integration with Google Job Search, and some third party themes/plugins use it to show listings on a map etc.

Getting an API key

You can get a Google Maps API by following Google’s instructions here.

Make sure your API key has the ‘Geocoding API’ enabled. Please follow this guide.

To use the API key, you must enable billing on your Google project. Google’s Geocoding API uses a pay-as-you-go pricing model. You get $200 USD free credit each month*, and you can set caps on your API usage to avoid being billed unexpectedly.

How to verify if Geocoding is working?

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 Preferences
  • Select the Panel tab
  • Under 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):

Geolocation Info and Custom Fields settings

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.

*accurate as of June 2019. Check Google’s terms and conditions for up-to-date billing information.