Are you using Google Maps API in your WordPress site? If so, chances are high that you found the MissingKeyMapError in your site. A few weeks earlier, Google Maps made a significant change about the way APIs work. According to the update, Google Maps does not allow keyless access.
Earlier, it was able to use Google Maps without an API key. However, starting from June 22, every request needs to be accompanied by an API key. If there is no API key, you will get MissingKeyMapError in no time. This is one of Google’s techniques to have more control over the usage of Google Maps.
In this article, we will see how you can fix the MissingKeyMapError on your WordPress website. There are multiple methods — depending on the Theme or Plugin
Table of Contents
How to Create an API Key for Google Maps?
- First, you need to log into
the Google Developer Console. - In the Developer Console API Library, you can see a bunch of Menus and sub-links. From the Google Maps APIs menu, select the Google Maps JavaScript APIs.
- In the upcoming page, you can create an API. It needs to be noted that you also need to create a Project in case if you don’t have one.
- In the Dashboard of individual API, you can see a link named ‘Credentials’. Click on that link
- Fill out the necessary details and you can get the API Key in a few seconds.
Implementing the API Key and Fixing MissingKeyMapError
Now, you will have the API Key with you. It’s time to add the created key into the API you use. Two scenarios may be there.
First, if you are using a third-party plugin for Google Maps implementation, you have an option to add the API Key. To do that, you can go to the Plugin management interface and paste the API Key. Following Google’s update, many developers have updated their plugins to include the fixes for MissingKeyMapError
Second, if you are coding from scratch, you need to paste the API Key in the source code. You have to find the area of API code and implement the newly-generated key in the field.
Wrapping Up
So, this is how you create a Google Maps JavaScript API Key and fix the MissingKeyMapError. The API is free to use until it reaches the 25000 requests per day limit. If your WordPress site makes more requests than 25000, you may need to buy the premium packages from Google.