The map on a contact page tells a customer where to go, and it fails quietly: a grey box, a box that says "This page can't load Google Maps correctly", a dark map stamped "For development purposes only", or nothing at all. There are six usual causes, and the first question settles most of them: is the map a plain Google embed, or does it need an API key? A plain embed is free and needs no key, so it is often the quickest fix of all. Below is a rebuilt example (not a real client), how to tell which cause you have, and the fix for each.
Google Maps JavaScript API error: BillingNotEnabledMapError; the name after "error:" is in the table below.<iframe src="https://www.google.com/maps/embed?..."> are embeds and need no key.If all the map has to do is show where you are, you do not need an API key, a Google Cloud account or billing at all.
<iframe>. In Elementor use the HTML widget, or the Google Maps widget with your address. Wix, Squarespace and Shopify each have an embed or map block that takes the same code.width="600" in the pasted code to width="100%" and keep the height.Store locators, maps with many pins, and themes with a key field need the Maps JavaScript API. Every fix below is in the Google Cloud console (console.cloud.google.com) under the project that owns the key; if nobody remembers whose Google account that is, it is often quicker to make a new project and key under the business's own account.
| Console error | What it means | What to do |
|---|---|---|
MissingKeyMapError / InvalidKeyMapError | No key was sent, or the key was deleted or mistyped | Create a key (APIs & Services > Credentials > Create credentials > API key) and paste it into the plugin or theme setting |
BillingNotEnabledMapError | The project has no billing account, so Google stops the map; this is also what puts "For development purposes only" on it | Link a billing account to the project (Billing in the console). Google gives a monthly free allowance that a small business's contact-page map normally stays inside; set a budget alert so you hear about any change |
ApiNotActivatedMapError | The key exists but the Maps JavaScript API is not switched on for its project | APIs & Services > Library > Maps JavaScript API > Enable. A store locator or an address search box may also need the Geocoding API or Places API; the plugin's settings page says which |
RefererNotAllowedMapError | The key is restricted to a list of websites and yours is not on it, very often after a domain change or a move from www to non-www | Edit the key's "Website restrictions" to include both https://yourbusiness.com/* and https://www.yourbusiness.com/* (and a staging address if you use one) |
ApiTargetBlockedMapError | The key's "API restrictions" do not include the Maps JavaScript API | Edit the key and tick Maps JavaScript API (and the others the plugin needs) under API restrictions |
ExpiredKeyMapError | The key was deleted or replaced | Make a new key and update the plugin setting |
Do keep the website restriction on. A key with no restriction can be copied out of your page source and used on other sites at your expense.
maps.googleapis.com and the map plugin's script from those settings, then clear the cache.http://. On an https site the browser blocks it as mixed content. Change it to https://. More in the "Not secure" guide.https://www.google.com as a frame source (for embeds), or maps.googleapis.com and maps.gstatic.com as script and image sources (for the API), leaves the box empty. The console names the blocked address; add it to the policy.For most small sites this is a five-minute swap to the free embed, or one setting in the Google Cloud console. If you would rather hand it over, or the map comes from a store locator with many locations, that is what the box below is for. Related: changes not showing (a cache serving the old page after the fix), an older site that shrinks on phones, and a slow site.