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

20326 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 WPRentals theme. Watch Video on Youtube

Overview

WPRentals can use Google Maps to display maps, property pins, location autocomplete, geocoding, and other location-related features.

To use Google Maps on your website, you need to create a Google Maps API key from your Google Cloud account and add it in the theme options.

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

Important: Google Maps Platform is managed by Google. Billing, pricing, free usage, API limits, restrictions, and service availability are controlled by Google and can change. Always check the official Google documentation for the latest rules.

CONTENT

  • Why you need a Google Maps API key
  • Before you start
  • How to get a Google Maps API key
  • Step 1: Enable billing in Google Cloud
  • Step 2: Create or select a Google Cloud project
  • Step 3: Enable the required APIs
  • Step 4: Create the API key
  • Step 5: Restrict the API key
  • Step 6: Add the API key in WPRentals
  • How to test if the API key works
  • Common reasons Google Maps does not load
  • Cost and usage control
  • Useful Google documentation

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.

In WPRentals, the Google Maps API key can be needed for:

  • Google Maps display.
  • Property pins on the map.
  • Half Map layouts.
  • Google Places autocomplete.
  • Location search suggestions.
  • Geocoding addresses and coordinates.
  • Street View or static map-related services, depending on your setup.

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 available free monthly usage.

Check Google’s official pricing and billing pages before using Google Maps on a live website:

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

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

Before You Start

Before creating the API key, make sure you have:

  • A Google account.
  • Access to Google Cloud Console.
  • A Google Cloud project for the website.
  • Billing enabled for the project.
  • The required Google Maps APIs enabled.
  • The website domain ready, so you can restrict the key correctly.
Important: If you use both the www and non-www versions of your domain, add both versions when restricting the API key.

How to Get a Google Maps API Key

Follow the steps below to create the Google Maps API key and add it in WPRentals.

Step 1: Enable Billing in Google Cloud

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

Google Cloud Console

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.



Important: WPRentals does not control Google billing. Billing, charges, free usage, quotas, and cost alerts are managed from your Google Cloud account.

Step 2: Create or Select a Google Cloud Project

In Google Cloud Console, create a new project for your website or select an existing project.

Use one project for the website so the API key, enabled APIs, restrictions, usage, and billing are easier to manage.

Step 3: Enable the Required APIs

In Google Cloud Console, go to:

APIs & Services > Library

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 the Google Cloud project connected to your API key.

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. 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.





Important: If the API key is restricted to the wrong domain, Google Maps will not load on the website. If you recently moved the site, changed domain, added SSL, or switched between www and non-www, update the API key restrictions.

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 the Google Maps API Key field and save the theme options.

Also check these settings:

  • Select Google Maps for the map system.
  • Select Google Places for the Places API option if you want to use Google location autocomplete.

Google Maps Settings in WPRentals

How to Test if the API Key Works

After adding the API key in WPRentals, test the website front end.

Check:

  • The map loads on pages where maps are enabled.
  • Property pins show on the map.
  • Half Map pages load the map correctly.
  • Google Places autocomplete works if enabled.
  • No Google Maps error message appears on the page.

If the map does not load, 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.
Tip: Google Maps console errors usually explain the problem. For example, they may mention billing, missing APIs, wrong referrer restrictions, invalid key, or quota limits.

Common Reasons Google Maps Does Not Load

If Google Maps does not load, check the following:

  • Billing is not enabled in Google Cloud.
  • The required APIs are not enabled.
  • Places API (New) is missing when Places autocomplete is used.
  • The API key is restricted to the wrong domain.
  • The website URL was added incorrectly in HTTP referrer restrictions.
  • The website uses www but only the non-www domain was added, or the opposite.
  • The website uses HTTPS but only the HTTP version was added.
  • The API key was copied incorrectly.
  • The wrong Google Cloud project was used.
  • The site cache still loads an old key.
  • A cache, optimization, or security plugin blocks Google Maps scripts.
  • The Google Cloud account has quota or billing restrictions.

After changing API key settings, clear all cache:

  • Theme cache, if used.
  • Cache plugin cache.
  • Server cache.
  • CDN cache, if used.
  • Browser cache.

Then test the map again in a private/incognito browser window.

Cost and Usage Control

Google Maps Platform pricing and usage limits are managed by Google from your Google Cloud account.

To control costs, check these options in Google Cloud:

  • Billing account settings.
  • Budget alerts.
  • API usage reports.
  • API quotas.
  • API key restrictions.

Google provides cost management documentation here:

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

Important: WPRentals cannot control Google Maps billing or API costs. Always manage billing, budget alerts, quotas, and restrictions inside your Google Cloud account.

Useful Google Documentation

Set up the Maps JavaScript API

Google Maps Platform API key security guidance

Places API migration overview

Google Maps Platform pricing overview

Manage Google Maps Platform costs

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
  • 33Owner & Renter
  • 8Page Templates
  • 24Property / Listing
  • 22Shortcodes
  • 4Supported Maps
  • 99Technical how to
  • 5Third Party plugins
  • 4Translation & Multi Languages
  • 3WordPress Blog Post
  • 13WordPress Widgets
  • 12WP Rentals Payments
  • 80WP Rentals Theme Options
  • 26WPML & Weglot

Join Us On

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