Avada Forums Community Forum GDPR Avada 5.5.2 – google fonts store locally. Reply To: GDPR Avada 5.5.2 – google fonts store locally.

Post count: 4

Michael C, thank you very much for your help!

I found a solution on Stack Overflow to prevent Google Maps from loading the Roboto font.

Create a /js/norobotofontbymaps.js in your child theme folder. Put this code into norobotofontbymaps.js:

var head = document.getElementsByTagName('head')[0];

// Save the original method
var insertBefore = head.insertBefore;

// Replace it!
head.insertBefore = function (newElement, referenceElement) {

    if (newElement.href && newElement.href.indexOf('//fonts.googleapis.com/css?family=Roboto') > -1) {

        console.info('Prevented Roboto from loading!');

    insertBefore.call(head, newElement, referenceElement);

Add this code to your functions.php:

/*prevent roboto fonts loaded by google maps api*/
$child_theme_url = get_stylesheet_directory_uri();
wp_register_script( 'norobotofontbymaps', $child_theme_url.'/js/norobotofontbymaps.js', 'jquery', "1", true);
wp_enqueue_script( 'norobotofontbymaps' );