Created
July 1, 2020 07:14
-
-
Save DarioBF/bf64408f9d7661d791f0347a2b3fa601 to your computer and use it in GitHub Desktop.
Remove jQuery from WordPress completely
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
/** * Completely Remove jQuery From WordPress */ | |
function my_init() { | |
if ( ! is_admin() ) { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', false ); | |
} | |
} | |
add_action( 'init', 'my_init' ); | |
/** * Completely Remove jQuery From WordPress Admin Dashboard */ | |
add_action( 'wp_enqueue_scripts', 'no_more_jquery' ); | |
function no_more_jquery() { | |
wp_deregister_script( 'jquery' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment