Remove all GD scripts from normal pages and posts.

This topic contains 3 replies, has 2 voices, and was last updated by  Alex Rollin 4 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #542488

    P O
    Expired Member
    Post count: 501

    I need to remove everything coming from GD in all pages and posts that have nothing to do with GD.

    1- I have a unique page for my GD Directory and places. (And of course GD pages)
    2- I have 10 other pages, including my Homepage and 500 normal posts. (Nothing related to GD)

    Those 500 normal posts and 10 pages get this inserted by GD.

    /wp-content/plugins/geodir_marker_cluster/assets/js/cluster_script.js?ver=1
    /wp-content/plugins/aawp/public/assets/js/scripts.min.js?ver=3.12
    /wp-content/plugins/invoicing/assets/js/jquery.blockUI.min.js?ver=2.70
    /wp-content/plugins/geodirectory/assets/js/goMap.min.js?ver=2.0.0.90
    /wp-content/plugins/geodirectory/assets/jawj/oms.min.js?ver=2.0.0.90
    /wp-content/plugins/geodirectory/assets/js/libraries/gd_lity.min.js?ver=2.0.0.90
    /wp-content/plugins/geodirectory/assets/js/geodir-select2.min.js?ver=2.0.0.90

    Maps things called by GD

    https://maps.google.com/maps/api/js?language=es&key=AIzaSyDBEe2Ept_JCNq3iVFbPGYwcHuiLv81SoY&libraries=places&ver=c90603a2ad9065dda9fd52adde9de792
    https://maps.google.com/maps-api-v3/api/js/40/10/intl/es_ALL/common.js
    https://maps.google.com/maps-api-v3/api/js/40/10/intl/es_ALL/util.js
    https://maps.google.com/maps-api-v3/api/js/40/10/intl/es_ALL/geocoder.js
    https://maps.google.com/maps-api-v3/api/js/40/10/intl/es_ALL/infowindow.js

    How can I remove everything and just call it where it is actually used. It makes no sense my complete site calls 40 scripts making everything slow because of this.

    Thanks.

    #542514

    Alex Rollin
    Moderator
    Post count: 27815

    You can start with this here, let us know -> Instructions for dequeue

    https://wpgeodirectory.com/docs-v2/faq/troubleshooting/

    #542517

    P O
    Expired Member
    Post count: 501

    So I have to ad this and done?

    add_action( ‘wp’, ‘wpdocs_dequeue_script’, 100 );
    function wpdocs_dequeue_script() {
    if (!geodir_is_geodir_page()){
    remove_action(‘wp_enqueue_scripts’, ‘geodir_templates_scripts’);
    remove_action(‘wp_enqueue_scripts’, ‘geodir_templates_styles’, 8);
    }
    }

    Thanks.

    #542544

    Alex Rollin
    Moderator
    Post count: 27815
Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount