Skip to content

How to generate Google Maps API Key for WordPress?

[rank_math_breadcrumb]

Table of Contents

Google requires an API key for every map it serves on your site.

This guide creates the key in Google Cloud and connects it to the Google Map block in Nexter Blocks.

For every Google Map setting in one place, see the Google Map block guide.

Before You Start

  • Edition: Free — the API key works for the Google Map block in Nexter Blocks (free) and with Nexter Blocks Pro.
  • Block to enable: Google Map, switched on under Nexter > Blocks in your WordPress dashboard.
  • A Google account and a payment card for Google Cloud billing. Google gives a monthly free usage allowance; check current pricing on Google’s site.

Create a Project and Billing

Google Cloud changes its screens often, so yours may look slightly different.

  1. Open the Google Maps Platform credentials page and create a new project. Give it a name and click Create.
Creating a new project in Google Cloud
  1. Choose your country, accept the terms and continue.
Choosing the country and accepting the terms in Google Cloud
  1. Create a billing account: name it and continue.
Naming a new billing account in Google Cloud
  1. Fill in the account type, tax and payment details and click Submit and Enable Billing.
The billing information form in Google Cloud
  1. Link the billing account to your project with Set Account.
Linking a billing account to the project

Get and Restrict the Key

  1. Answer Google’s short questions. Your API key then appears. Copy it.
Google Maps Platform showing the new API key
  1. Open the key’s settings. Under API restrictions, choose Restrict key and select Maps JavaScript API. Do not pick Maps Embed API: the block uses the JavaScript API.
  1. Under Application restrictions, choose Websites and add your domain, for example https://example.com/*. Save.
  1. Check APIs in the left menu to confirm Maps JavaScript API is enabled.
The list of enabled APIs in Google Maps Platform

Connect the Key in Nexter

  1. In WordPress, go to Nexter > Extra Options > Settings.
  1. Turn on Connect Google Maps API Key, click its settings gear, paste the key into Enter API Key and click Save.
The Connect Google Maps API Key card in Nexter Extra Options Settings

How It Behaves

  • One key serves every Google Map block on your site.
  • The block loads Google’s Maps JavaScript API with this key on pages that contain a map.
  • Restricting the key to your domain stops other sites from using it.

Limitations

  • Google requires billing on the project, even if your traffic stays inside the free allowance.
  • A key restricted to the Maps Embed API only will not work with this block.

Troubleshooting

The map shows “This page can’t load Google Maps correctly”

Billing is not active, the Maps JavaScript API is not enabled, or the key’s website restriction does not match your domain. Fix it in Google Cloud and reload the page.

It works on my live site but not on staging

Add the staging domain under Application restrictions.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!