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.
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:
- Maps JavaScript API
- Maps Static API
- Places API
- Places API (New)
- Geocoding API
- Geolocation API
- 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.
- Open your website in Chrome.
- Right-click on the page and select Inspect.
- Open the Console tab.
- 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








