How to generate and set a Google Maps Geocoding API (server) key
Warning: You must have a Google account to generate a key for Google Maps Geocoding API.
Since June 2016, Google Maps requires a special Google Maps Geocoding server key to “translate” addresses into geographical locations (longitude/latitude). Without this key, Yoast SEO: Local may not be able to make this translation for you.
Before you can set this server key in your Yoast SEO: Local installation, you’ll need to generate it. This tutorial will show you how to do that.
Generate a Geocoding server key
- Go to the Google API Console.
- Click ‘Get A Key’.
- If you want to use an existing project, please select it from the list.
- Otherwise, select ‘Create a new project’ and enter a project name.
- Click ‘Enable the API’ (existing projects) or ‘Create and Enable API’ for new projects
- Copy the generated browser key from the popup, you’ll need this to set your server key later.
- To prevent quota theft, secure your API key following these best practices.
- (Optional) Enable billing. See Usage Limits for more information.
Set your Geocoding server key
- Copy the server key you generated from the Google Maps API Manager.
- Log in on your WordPress Admin and navigate to SEO > Local > API Keys.
- Paste the server key you copied in step 1. into the ‘Google Maps API server key’ field.
- Click Save Changes to store your server key.
- Your site should now be able to automatically calculate the latitude and longitude for locations you add.
If you have trouble translating addresses into geographical locations, please verify that the Google Maps Geocoding API is enabled in the Google Maps API Manager.