How to generate and set a Google Maps API key
Google Maps requires a special Google Maps API key. Without this key, you cannot display Google Maps on your website. There used to be two separate keys, the Google Maps API browser key and the Google Maps API GeoCoding key. Since Yoast Local SEO 11.9, only one Google Maps API key is required.
Want to learn all about local SEO? In our Local SEO training, you’ll learn how to optimize the website of your local business for search engines. So you’ll start ranking in your area! Check out our Local SEO training.
Before you can set this API key in your Local SEO installation, you’ll need to generate it. This tutorial will show you how to do that.
For ultimate SEO optimization, you need Yoast SEO Premium! For example, its advanced text analysis helps you write naturally flowing texts. The internal linking tool and the content filters make your posts easy to find. 404 errors become a thing of the past with the redirect manager. And the social previews give you full control of how your posts appear on social media. Get Yoast SEO Premium!
Table of Contents
Generate a new API key
- Go to the Google Maps Platform
- Click ‘Get Started’
- Check ‘Maps’, ‘Routes’ and ‘Places’
- Click ‘Continue’
- 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 ‘Next’ to continue
- If you haven’t set up your billing account yet, follow the steps Google gives you to set it up.
- Click ‘Next’ to enable the APIs for the project
- Copy the generated API key from the popup, you’ll need this to set your key later.
View your existing API keys
- Go to the Google Maps Platform
- If the side menu is not visible, click the three-line (hamburger) menu icon
- Click ‘APIs & Services’ (API icon)
- Click ‘ Credentials’ (key icon)
If the above steps are not clear enough then please follow the tutorial video from the Google Maps Platform Team below. This video will show you how to generate and restrict API keys.
Add API key to Yoast SEO: Local
- Copy the API key you created from the Google Maps Platform.
- Log in to your WordPress website.
When you’re logged in, you will be in your ‘Dashboard’.
- Click on ‘SEO’.
On the left-hand side, you will see a menu. In that menu, click on ‘SEO’.
- Click on ‘Local SEO’.
The ‘SEO’ settings will expand providing you additional options. Click on ‘Local SEO’.
- Click on ‘API Keys’.
- Paste the API key you copied in step 1 into the ‘Google Maps API key’ field.
- Click ‘Save Changes’.
Check to see if Google Maps API keys are working
To check to see if your Google Maps are working try adding one by using a shortcode.
Are Google Maps not working?
If your Google Maps are not working for some reason, be sure to check out our troubleshooting article.
Securing your Google Maps API key
It’s recommended to secure your Google Maps API key against quota theft. In this article, we explain exactly how you can secure your Google Maps API key.
Pricing for the Google Maps, Routes and Places is pay as you go, and you only pay for what you use. You get a recurring $200 credit on your billing account each month to offset your usage costs, and you can also set usage limits to protect against unexpected cost increases.
For a table of Google’s pricing, see Pricing for Maps, Routes, and Places.