Use code PERFMATTERS for an extra 10% off!

How to disable Google Maps API in WordPress

Some WordPress themes and plugins have Google Maps API built-in and unfortunately sometimes don’t have a way to turn it off. Google maps, unfortunately, can wreak havoc on your site’s performance, even though the requests are loaded async. Typically a request is made via the official Google Maps API to the following URL:

//maps.googleapis.com/maps/api/*

There might also be additional requests to the following URL:

//maps.gstatic.com/mapfiles/*

And here is an example of a map plugin running on WordPress. Take a look at all the requests made to Google Maps. 20 HTTP requests just to load one map. Depending on the integration there might be fewer or more requests.

http request to maps.google.com/maps/
http request to maps.google.com/maps/

Disable Google Maps API

Follow the steps below to disable Google Maps API. Note: This will, of course, break your maps, so only use if you aren’t needing Google maps on your site.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 2

Under the “Options” tab and “General” sub-navigation menu, toggle on “Disable Google Maps.”

Disable Google Maps API in WordPress
Disable Google Maps API in WordPress

Step 3

Scroll down and click “Save Changes.”

Exclude Post IDs

You can exclude Google Maps from being disabled on specific post IDs (posts, pages, blog feed, homepage, custom post types, etc). Simply enter the post IDs, comma-separated. If your blog page is set to posts, you can also enter blog as a value.

Here is an example:

23,29,blog
Exclude Post IDs from Google Maps disable
Exclude Post IDs from Google Maps disable

Scroll down and click “Save Changes.”

Was this article helpful?

Related Articles