Skip to content

Instantly share code, notes, and snippets.

@bilalmalkoc
Last active February 19, 2023 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bilalmalkoc/4491b46bff30035b1f347b51003563d2 to your computer and use it in GitHub Desktop.
Save bilalmalkoc/4491b46bff30035b1f347b51003563d2 to your computer and use it in GitHub Desktop.
Disable Elementor frontend scripts.
// 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