I wonder how I can prevent the theme from contacting Google Maps (what it obviously does). I don’t use Google maps and don’t want anything to get in contact with a google maps website. Still need access to Google fonts.
Any ideas?
Cheers, Timo
I wonder how I can prevent the theme from contacting Google Maps (what it obviously does). I don’t use Google maps and don’t want anything to get in contact with a google maps website. Still need access to Google fonts.
Any ideas?
Cheers, Timo
Hi Timo,
Thank you for contacting us. I am happy to help with your queries.
Try adding the below snippet to your child theme’s functions.
function sydney_pro_child_remove_googlemap_api() {
wp_dequeue_style( 'sydney-gmaps-api' );
}
add_action( 'wp_enqueue_scripts', 'sydney_pro_child_remove_googlemap_api', 999 );
Or use Code Snippets plugin if you aren’t running any child theme.
Regards,
Kharis
aThemes Support
Seems to work perfect in my child theme functions!
Thanks Kharis.
Cheers, Timo
You’re welcome Timo!
Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.
Regards,
Kharis
aThemes Support
Hi Kharis.
Seems like I was a bit to quick
The site still tries to contact google maps requesting an API key. Despite the fact that I included your code in the child themes function.php
In the console I get a warning from “utils.js”: util.js:228 Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
Yz.o @ util.js:228
Any further idea?
Website: www.poetryman.de
Hi,
Have you checked whether it comes from other plugin or not by temporarily disabling all other plugins?
Regards,
Kharis
Hi Kharis, I get the Google Maps warning even with all PlugIns deactivated …
Hi,
Try this code:
function sydney_pro_child_remove_googlemap_api() {
wp_dequeue_script( 'sydney-gmaps-api' );
}
add_action( 'wp_enqueue_scripts', 'sydney_pro_child_remove_googlemap_api', 999 );
Regards,
Kharis
aThemes Support
Excellent! Tiny change - big results. This now works!
Again - I appreciate your excellent suppot!
Cheers, Timo
You’re welcome!
Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.
Regards,
Kharis
aThemes Support