WPRentals Theme Documentation WPRentals Theme Documentation

  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API
Home / Supported Maps / Google Maps – How to add Google API Key

Google Maps – How to add Google API Key

20297 views
Before reading this help article, you may want to check this video. It explains how to create a Google Maps API key and how to add it in the theme. Watch Video on Youtube

Why You Need a Google Maps API Key

Google Maps requires an API key before maps and location services can be used on your website.

The API key connects your website to your Google Cloud project and allows Google Maps services to load on your WPRentals website.

Google Maps Platform uses a pay-as-you-go pricing model. Billing must be enabled in Google Cloud for production use, even if your website stays within Google’s free monthly usage limits.

Pricing, free usage, and billing rules are managed by Google and can change. Always check the official Google Maps Platform pricing pages for the latest details.

https://developers.google.com/maps/billing-and-pricing/overview

https://developers.google.com/maps/billing-and-pricing/manage-costs

How to Get a Google Maps API Key

Step 1: Log in to Google Cloud Console

Go to Google Cloud Console and sign in with your Google account.

Google Cloud Console

Step 2: Set Up Billing

Google requires billing to be enabled for Maps Platform APIs used on live websites.

Add your billing details in the Google Cloud Billing section before using the API key on your website.



Step 3: Create a Project and Enable the Required APIs

Create a new project in Google Cloud Console or select an existing project for your website.

Then go to APIs & Services > Library and enable the APIs needed by the theme.

For WPRentals Google Maps features, enable:

  1. Maps JavaScript API
  2. Maps Static API
  3. Places API
  4. Places API (New)
  5. Geocoding API
  6. Geolocation API
  7. Street View Static API



Important: Google has introduced Places API (New). Make sure Places API (New) is enabled in APIs & Services for your Google Cloud project.

If your account or project still uses older Places services, check that both the required Places API options are enabled for the API key used on the website.



Step 4: Create the API Key

In Google Cloud Console, go to APIs & Services > Credentials.

Create a new API key for your website.





Step 5: Restrict the API Key

For security, always restrict your API key.

An unrestricted API key can be used by other websites if copied, and this can create unwanted usage or billing on your Google Cloud account.

For a website, use HTTP referrer restrictions and add your website domain.

Use wildcard domain rules so the key works on all pages of your website.

Examples:

  • https://yourdomain.com/*
  • https://www.yourdomain.com/*

If your website uses both the www and non-www versions, add both versions.

If your website uses a staging domain or subdomain, add that domain too while testing.





Step 6: Add the API Key in WPRentals

Copy the API key from Google Cloud Console.



In WordPress admin, go to:

Theme Options > Map Configuration > Map General Settings

Paste the key in Google Maps API Key and save the theme options.

Also check these settings:

  • Select Google Maps for the map system.
  • Select Google Places for the Places API option.



How to Check if the API Key Is Correct

If Google Maps does not load on your website, check the browser console for Google Maps errors.

  1. Open your website in Chrome.
  2. Right-click on the page and select Inspect.
  3. Open the Console tab.
  4. Look for Google Maps error messages.

Common causes include:

  • Billing is not enabled in Google Cloud.
  • The required APIs are not enabled.
  • The API key is restricted to the wrong domain.
  • The wrong website URL was added in HTTP referrer restrictions.
  • The API key was copied incorrectly.
  • The site cache still loads an old key.

After changing the API key settings, clear website cache, server cache, CDN cache if used, and browser cache. Then test the map again.

Useful Google Documentation

Set up the Maps JavaScript API

Google Maps Platform API key security guidance

Places API migration overview

Supported Maps

Related Articles

  • Map type: Open Street Maps or Google Maps
  • Theme Options → Map Configuration → Number of Pins Settings
  • Theme options – Map Configuration Settings

HELP CATEGORIES

  • 61. General
  • 72. Installation & Basic Setup
  • 373. How Booking Works
  • 18Advanced Search
  • 17Elementor WPRentals Studio
  • 14Email Notifications
  • 23FAQ
  • 14Installation FAQ
  • 10Menu Options
  • 34Owner & Renter
  • 8Page Templates
  • 23Property / Listing
  • 22Shortcodes
  • 4Supported Maps
  • 98Technical how to
  • 5Third Party plugins
  • 4Translation & Multi Languages
  • 3WordPress Blog Post
  • 13WordPress Widgets
  • 12WP Rentals Payments
  • 79WP Rentals Theme Options
  • 26WPML & Weglot

Join Us On

Powered by WP Estate - All Rights Reserved
  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API