Used to modify the url parameters used to load the Google Maps JS API.

Primarily, this filter exists to set a Google API key, however, it may also be used to customize other_params used in the google.load function.


  • Added in version 5.3.10


apply_filters( 'acf/fields/google_map/api', $args );


(array) Array of url parameters.

  • libraries
    (string) A comma separated list of libraries to load. Defaults to “places”.

    'libraries' => 'places',
  • key
    (string) A Google Maps API key. Defaults to an empty string.

    'key' => '',
  • client
    (string) Optional. A Google API client ID. Defaults to an empty string.

    'client' => '',


This example demonstrates how to register a Google API key to be used when loading the Google Maps JS library.


add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
function my_acf_google_map_api( $args ) {
    $args['key'] = 'xxx';
    return $args;

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.