Google Maps Not Working in WordPress
Displaying a Google Maps element on your WordPress website is very common these days. You’ll rarely see a company or a product website without a proper location/map area. But whenever you find a theme or a plugin that uses Google Maps, there’s an extra step involved to make the map work. For new domains, the map often shows as a gray area and does not work at all. You are probably getting the “Oops! Something went wrong.” Google Maps Not Working error. Let’s explore the possible methods to solve the error –
Fix the Google Maps Not Working Error
The Google Maps Not Working error in WordPress appears because you need to add an API key to make the maps work properly. This is a requirement since June 2016, and it is related with how Google handles traffic for the Google Maps service. Follow the steps bellow to properly display the maps on your website:
1. Getting an API Key
- Standard API users. This is good for most people, as you get 25,000 map loads in 24 hours. If you exceed this limit, you can setup a pay-as-you-go billing to adjust things depending on your website traffic.
- Premium Plan users. This package is paid one, but you get significantly higher map load limit as well as some other advantages like 24-hour technical support. This plan is intended for websites that receive large amounts of traffic, and 90% of the time, it doesn’t apply to WordPress websites and blogs.
2. Registering the Key with your URL
Now that you know the difference, you can start with the free Standard API package by clicking on the blue “Get a Key” button. Note that you must have a Google Account and be signed in when you do this. Once you click the button, a window will pop-up on the screen asking you for a project name and TOS agreement. The name can be anything you like, but it is conventional to write your website’s name.
Make sure you register the Google Maps API with your URL, or else you would still have the Google Maps Not Working error. We must associate the URL with our new Google Maps API.
After a few seconds, you’ll get a “You’re all set!” window with your API key. You need to copy this key, because now we’re going to use it in WordPress. To improve your website’s or app’s security, you can restrict the key’s usage from Google’s API console.
Using Your API Key in WordPress
Sometimes, the Google Maps still works on older domain names. If we wish to display the Google Maps on a new domain, we must register an API key or else we may get the “Oops! Something went wrong.” Google Maps Not Working error. displayed when you were checking it out, is because the developers were using their own API key for previewing the theme’s features. This also applies to plugins. To display the map with your location, you must use the API key generated in the section above. How can we do that? Well, it all depends on the package. The developers either reserved a field in the theme/plugin settings for the API key, or you need to find the API request into the code, and insert it yourself.
To find out which option applies in your case, go through the options page, and look for Google Maps API key section. You can also ask around on forums and support pages. If there is a field, you just paste in your key and you’re all set! Now, when you reload the website, your location should be displayed.
If you need a savvy WordPress developer to help you out, please consider Hiring an Expert.