How to Remove jQuery Migrate in WordPress Site?

It’s better to keep updated jQuery in your WordPress site. You will notice jQuery Migrate notice inside your dashboard when your theme or any plugin uses an outdated jQuery version. 

At present maximum theme or plugin don’t need jquery-migrate.min.js file. It’s unnecessary to load this script on your site. WordPress already maintains jQuery itself. 

It’s too easy to remove jQuery Migrate from WordPress website. You need to place the following code inside your function.php file. Make sure you are editing your active theme function.php file. 

				
					// Remove jQuery Migrate
add_action('wp_default_scripts', '_remove_jquery_migrate', 9999);
function jltwp_adminify_remove_jquery_migrate($scripts){
    if (!is_admin() && isset($scripts->registered['jquery'])) {
        $script = $scripts->registered['jquery'];
        if ($script->deps) { // Check whether the script has any dependencies
            $script->deps = array_diff($script->deps, array(
                'jquery-migrate'
            ));
        }
    }
}
				
			

Remove jQuery Migrate using WP Adminify Plugin

So if you are so exeprt in coding stuff, then WP Adminify will solve the problem for you. You can solve jQuery Migrate issue in one click via WP Adminify. 

After WP Adminify activation you will notice a new Dashboard menu item called “WP Adminify“. Click on this option and navigate to tweak > Performance. Or, you can check WP Adminify Tweaks option too. The first performance tweak is Remove jQuery Migrate

Just enable it and save the plugin setting. 

Remove jQuery Migrate
Was this article helpful?

© 2021 - Adminify | All rights reserved

WP Adminfy accepted payment methods