Stop loading jQuery Migrate
jQuery Migrate helps very old jQuery code run. Most sites don’t need it on the public pages; the admin keeps it.
<?php
add_action(
'wp_default_scripts',
static function ( $scripts ) {
if ( is_admin() || empty( $scripts->registered['jquery'] ) ) {
return;
}
$jquery = $scripts->registered['jquery'];
$jquery->deps = array_values( array_diff( $jquery->deps, array( 'jquery-migrate' ) ) );
}
);
Good to know
After switching it on, check your pages and the browser console. If a slider or menu stops working, switch it off again.
In these packs
- Clean up the head: Remove the links, scripts and styles WordPress adds to every page that most sites never use.
- Performance: Small changes that save the server and the browser some work.