New Landing How can we help? Themeforest Theme Support Dante How to block google maps https://csi.gstatic.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #329427
    Frankytank
    Member
    Post count: 97

    Hi,

    I’m in the process of improving my website speed and I found out that there is a google maps code that slow down my webpage load time even if I don’t have a google maps frame in my home page.

    https://csi.gstatic.com/csi?v=2&s=mapsapi3&v3v=29.7&action=apiboot2&e=10_1_0,10_2_0&rt=main.9

    Is there a way to block this everywhere but on the page where the google maps frame is?

    Many thanks

    #329441
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Try to add the code below to the functions.php of your child theme.

    function denqueue_scripts_google_maps() {
    
       wp_dequeue_script( 'google-maps' );
       wp_deregister_script( 'google-maps' );
     
    }
     
    add_action( 'wp_enqueue_scripts', 'denqueue_scripts_google_maps', 100 );

    -Rui

    #329463
    Frankytank
    Member
    Post count: 97

    Hi,

    I actually found a great plugin that block ressources where not needed.

    I blocked the js key from being load everywhere and I just load it where I have a map showing…

    Thanks!

    #329466
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem. Glad it’s sorted.

    -Rui

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register