Remove jQuery Migrate on the Front End
Drops the jQuery Migrate compatibility script from public pages. Only use it when your theme and plugins work with current jQuery.
Opens WPIDE on
Code
add_action( 'wp_default_scripts', function ( $scripts ) {
if ( is_admin() || empty( $scripts->registered['jquery'] ) ) {
return;
}
$scripts->registered['jquery']->deps = array_diff( $scripts->registered['jquery']->deps, array( 'jquery-migrate' ) );
} );
Notes
Check the browser console for jQuery errors after enabling.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.