Back to Blog

How to Get a Google Maps API Key for WordPress (and Keep It Safe)

Create a Google Maps API key for WordPress step by step — the APIs to enable, restricting the key to your site, billing basics and fixing common errors.

To get a Google Maps API key for WordPress, create a project in the Google Cloud console, add a billing account, enable the Maps JavaScript API and the other APIs your map uses, then create an API key under Credentials. Restrict it to your website and those APIs, and paste it into your map plugin — in GeoVerse Maps, under Settings → GeoVerse Maps.

You don't need a key just to show your location — GeoVerse Maps shows a keyless embed. You need one for markers, custom styles, search, filters, directions and layers.

Step 1: create a project

  1. Go to the Google Cloud console (console.cloud.google.com) and sign in.
  2. Click the project picker → New project, name it after your site, and create it.

Step 2: set up billing

Google Maps Platform requires a billing account, even for usage within the monthly free allowance. Open Billing, link a billing account to the project, and set a budget alert so you're told if usage climbs. Check the Google Maps Platform pricing page for current terms.

Step 3: enable the APIs

Go to APIs & Services → Library and enable what your map uses. For GeoVerse Maps:

APIUsed for
Maps JavaScript APIThe interactive map, markers, styles and traffic, transit and bicycling layers
Places APIThe visitor-facing search box
Geocoding APILooking up addresses while you build the map in the editor
Directions APIThe Get Directions route from the visitor's location

If you don't use search or directions, skip those APIs. Google sometimes offers newer versions of an API alongside older ones; if you're unsure which to enable, enable the option the console recommends and test the feature.

Step 4: create and restrict the key

  1. Go to APIs & Services → Credentials → Create credentials → API key.
  2. Click the new key to edit it.
  3. Under Application restrictions, choose Websites and add your domains:
    • https://example.com/*
    • https://www.example.com/*
    • Your staging site, if you test there.
  4. Under API restrictions, choose Restrict key and tick only the APIs from step 3.
  5. Save.

An unrestricted key in your page source can be copied and used elsewhere on your bill. Restrictions stop that.

Step 5: add it to WordPress

In GeoVerse Maps, paste the key in Settings → GeoVerse Maps, or in the API Key panel of any map block — it's one site-wide setting either way. Reload the editor and the block's marker, style, search, filter and directions settings are available.

Troubleshooting

SymptomLikely causeFix
"This page can't load Google Maps correctly"Billing not enabled, or an API not enabledLink billing; enable the APIs
RefererNotAllowedMapError in the consoleDomain missing from restrictionsAdd the exact domain with /*, including www
ApiNotActivatedMapErrorMaps JavaScript API offEnable it
Search box does nothingPlaces API not enabled or not allowed by the keyEnable it and add it to the key's API list
Directions failDirections API not enabled or not allowedEnable it and add it to the key's API list
Works on the live site, not stagingStaging domain not listedAdd the staging URL

Keep costs predictable

  • Only enable what you use.
  • Set a budget alert in Cloud Billing.
  • Use one map per page, not several.
  • Keep the keyless embed on simple pages like a contact page where one pin is enough.

Ready? Build a store locator or a contact page map with GeoVerse Maps — every feature is free.

Common Questions

In the Google Cloud console, create a project, add a billing account, enable the Maps JavaScript API and the other APIs your map uses, then go to Credentials → Create credentials → API key. Restrict the key to your website and those APIs, and paste it into your map plugin's settings.

The Maps JavaScript API for the interactive map and layers, the Places API for the visitor search box, the Geocoding API for looking up addresses in the editor, and the Directions API for Get Directions. Enable only what you use.

Creating a key is free, but Google requires a billing account. Google Maps Platform includes monthly free usage that covers many small sites. Check Google's pricing page for current limits, and set budget alerts.

Add an application restriction of type Websites (HTTP referrers) with your domain, such as https://example.com/*, and an API restriction listing only the APIs your map uses.

Usually the key is missing, billing isn't enabled, a required API isn't enabled, or the referrer restriction doesn't match your domain. Your browser's developer console shows the exact error name.

No. GeoVerse Maps shows a basic embedded Google map without a key. You need one for markers, styles, search, filters, directions and layers.

Get new guides and releases by email

Occasional emails when we publish a guide or ship a notable plugin update. No spam — unsubscribe any time.

We only use your email to send these updates. See our privacy policy.