How to Remove jQuery Migrate JS from a WordPress Website?

Do you want to remove the jQuery migrate JS file from a WordPress website?

By default, WordPress renders jQuery migrate to add support for older jQuery versions. This is primarily because jQuery migrate may be required in some older WordPress themes.

Not all WordPress themes needed jQuery migrate. So if you are using WordPress themes that don’t need jQuery migrate JS file, consider removing it to increase the performance of the WordPress site.

The below code snippet removes the jQuery migrate file.

 * Remove jQuery Migrate from WordPress website
 * @param obj $scripts
 * @return obj $scripts
function maverick_remove_jquery_migrate($scripts)
    // Don't remove jQuery Migrate for admin pages
    if (!is_admin() && isset($scripts->registered['jquery'])) {
        $scripts->registered['jquery']->deps = array_diff(

add_action('wp_default_scripts', 'maverick_remove_jquery_migrate');

Leave a Reply

Your email address will not be published. Required fields are marked *