Title: Google location &amp; API key
Last modified: February 5, 2025

---

# Google location & API key

 *  Resolved [newspatron](https://wordpress.org/support/users/newspatron/)
 * (@newspatron)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/google-location-api-key/)
 * I was trying to add to a google location as a field group in order to add the
   same to a listing.
 * i dont see an option to add a google map key. i already have the key, but i would
   like to know how to add the same in the SCF plugin.
 * there is no field for that.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Yan Metelitsa](https://wordpress.org/support/users/yanmetelitsa/)
 * (@yanmetelitsa)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/google-location-api-key/#post-18285884)
 * To add an API key to use the Google Maps field, you need to add this code to 
   your theme’s `functions.php` file:
 *     ```wp-block-code
       // Sets Goolge Maps API key.add_filter( 'acf/fields/google_map/api', function ( $api ) {    $api[ 'key' ] = 'your-api-key';    return $api;});
       ```
   
 * The following services must be included in this key to work properly: **Maps 
   JavaScript API**, **Geocoding API**.
 * I’m not sure, but I’m guessing it’s not possible to do this with the interface.
 *  Thread Starter [newspatron](https://wordpress.org/support/users/newspatron/)
 * (@newspatron)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/google-location-api-key/#post-18286429)
 * Thanks for your swift reply. i hope i can use the same as i want.
 *  [cjmcqueen](https://wordpress.org/support/users/cjmcqueen/)
 * (@cjmcqueen)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/google-location-api-key/#post-18307060)
 * I have the same question, but I’m hosted on WordPress.com and apparently I can’t
   edit the functions.php file. Is there another way to register the API for Google
   Maps with Secure Custom Fields?
 *  [Yan Metelitsa](https://wordpress.org/support/users/yanmetelitsa/)
 * (@yanmetelitsa)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/google-location-api-key/#post-18307061)
 * [@cjmcqueen](https://wordpress.org/support/users/cjmcqueen/), In the admin panel
   try to go into **Appearance** > **Theme File Editor**, select your theme and 
   in the list on the right side select `functions.php`

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Google location & API key’ is closed to new replies.

 * ![](https://ps.w.org/secure-custom-fields/assets/icon.svg?rev=3194494)
 * [Secure Custom Fields](https://wordpress.org/plugins/secure-custom-fields/)
 * [Support Threads](https://wordpress.org/support/plugin/secure-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/secure-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/secure-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/secure-custom-fields/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Yan Metelitsa](https://wordpress.org/support/users/yanmetelitsa/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/google-location-api-key/#post-18307061)
 * Status: resolved