remove jquery migrate from wp site

Solutions on MaxInterview for remove jquery migrate from wp site by the best coders in the world

showing results for - "remove jquery migrate from wp site"
Pauline
06 Oct 2020
1Removing jQuery migrate from WordPress is quite easy. You just need to add the 
2following lines of code to your theme’s functions.php file.
3
4//Remove JQuery migrate
5 
6function remove_jquery_migrate( $scripts ) {
7   if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
8        $script = $scripts->registered['jquery'];
9   if ( $script->deps ) { 
10// Check whether the script has any dependencies
11
12        $script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) );
13 }
14 }
15 }
16add_action( 'wp_default_scripts', 'remove_jquery_migrate' );