Skip Navigation

[Resolved] Split: Using domain restricted Google Maps API key

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Waqar 4 years ago.

Assisted by: Waqar.

Author
Posts
#1835285

Hi Waqar

My apologies for missing out on the closing of the [wpv-for-each] tag.. I've fixed it and it works fine..:-)..

I had one quick query.. the MAPS API works only in Unrestricted Mode on Google Developers Console.. is this correct? Is there anyway I can have the API restricted to use only from my domains? If it's a feature request then can you please consider this as a feature request? Or please do guide me on how do I ask for this as a feature request.

Regards,
Alim

#1835309

Hi Alim,

If you'll go to WP Admin -> Toolset -> Settings -> Maps, you'll see that there are two fields to enter Google Map API keys.

When only the main/primary key is added, it is used for both the client-side and the server-side requests.

The key with domain restriction works for the client-side requests, but not for the server-side ones. To overcome this limitation, the second optional key field was introduced.

When you'll include a second optional key, that will be used for the server-side requests, allowing you to use a primary key with the domain restriction turned on.

If your hosting server has a static IP, you can optionally enable IP restrictions on the second key too, but it is not neccessary, since this second key for the server-side requests is not publicaly exposed.

I hope this explaination helps.

regards,
Waqar

#1835459

Hi Waqar

Thanks for the update..:-).. I am glad to know that this option exists where I can use restrictions for the API

I think I understand what you are saying but I just wanted to confirm one thing..

For the second optional key, do I use the same credentials?
OR
Do I create another set of credentials on Google Developer Console to use as the second optional key?

Please do advise.

Regards,
Alim

#1835533

Hi Alim,

Yes, you'll use the new credentials option to create a seperate/independant key.
( screenshot: hidden link )

regards,
Waqar

#1839529

Hi Waqar

Sorry for the delay.. was travelling a bit (I know 'travelling' does sound weird as an excuse during the pandemic..;-).. but in Bali we still can..;-)..)

Will have the credentials things tested asap and confirm with you.

Regards,
Alim

#1839799

Sure, please take your time 🙂