Hi
Thank you for reaching out.
Please use the following filter to remove the map scripts completely from your website. You can use this snippet at the end of the functions.php file of the current active theme or you can use any snippet plugin.
add_filter('directorist_scripts', function ($scripts) {
unset($scripts['directorist-openstreet-map']);
unset($scripts['directorist-google-map']);
return $scripts;
});
Please inform us if you need further assistance.
Kind Regards
Thanks @mahfuz87!
It works, but what if I want to do the same for CSS? I still have these loaded:
- wp-content/plugins/directorist/assets/vendor-css/openstreet-map/openstreet.css
- wp-content/plugins/directorist/assets/vendor-css/openstreet-map/leaflet.css
Hello Gerard
Please try the following code to get rid of those css files.
add_filter('directorist_scripts', function ($scripts) {
unset($scripts['directorist-openstreet-map']);
unset($scripts['directorist-openstreet-map-leaflet']);
unset($scripts['directorist-openstreet-map-openstreet']);
unset($scripts['directorist-google-map']);
return $scripts;
});
Please inform me if you need further assistance.
Kind Regards