How to generate and set a Google Maps Geocoding server key
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.
- Create a new project or select an existing project.
- If you do not have an active API project yet, you’ll be asked to agree to the terms of service. A new project will be created automatically.
- If you already agreed to the terms, you are requested to select an existing one, or create a new project.
- Click Continue to enable the API and any related services.
- On the Credentials page, select Google Maps Geocoding API and Web Server (e.g. node.js, Tomcat) if requested.
- Name your server key and restrict it to your server’s IP.
- Copy the generated server key from the popup, you’ll need this toset 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.