Last active
February 19, 2023 15:39
-
-
Save bilalmalkoc/4491b46bff30035b1f347b51003563d2 to your computer and use it in GitHub Desktop.
Disable Elementor frontend scripts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disable Elementor frontend scripts on frontedn. | |
function _my_theme_remove_plugin_scripts() { | |
if ( is_admin() ) { | |
return; | |
} | |
wp_dequeue_script( 'swiper' ); | |
wp_dequeue_style( 'swiper' ); | |
wp_deregister_script( 'swiper' ); | |
wp_deregister_style( 'swiper' ); | |
wp_dequeue_style( 'elementor-icons' ); | |
wp_deregister_style( 'elementor-icons' ); | |
wp_dequeue_script( 'elementor-web-cli' ); | |
wp_deregister_script( 'elementor-web-cli' ); | |
wp_dequeue_script( 'elementor-webpack-runtime' ); | |
wp_deregister_script( 'elementor-webpack-runtime' ); | |
} | |
add_action( 'wp_footer', 'eviye_remove_plugin_scripts' ); | |
add_action( 'wp_enqueue_scripts', 'eviye_remove_plugin_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment