How To Remove jQuery Migrate From WordPress
Do you want to Remove jQuery Migrate from WordPress? Just to support older versions of jQuery files of un-updated themes and plugins WordPress loads jquery-migrate.min.js. Almost all Of the themes and plugins are not using these files anymore.
Simply loading a file without any reason is not fissionable. So many people suggested to increase speed should remove these files. It will affect the website’s total loading time. But if it is creating an issue with your website please avoid these things.
How to remove jQuery migrate from WordPress?
There are mostly 2 ways to perform this option
- By using Plugins
- Without Using Plugins
So let’s get started without the first method
1 By using the Free Remove jQuery Migrate By plugin
2nd Method Without Plugin By using function.php
You just need to paste the below-mentioned code inside your function.php file to disable this jquery-migrate.min.js from your WordPress site.
function gomahamaya_remove_jquery_migrate( $scripts ) { if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) { $script = $scripts->registered['jquery']; if ( $script->deps ) { $script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) ); } } } add_action( 'wp_default_scripts', 'gomahamaya_remove_jquery_migrate' );
Note – If any of your website content plugins or themes stopped loading then please and please . Don’t disable this File