How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated features and behaviors so that older code will still run properly on the current jQuery version and later.

Most up-to-date frontend code and plugins don’t require jquery-migrate.min.js. In most cases, this simply adds unnecessary load to your site. You can see this running if you launch Chrome Devtools console.

Other reasons to remove jQuery Migrate:

  • It’s better to keep your code, themes, and plugins updated than it is to patch in support of an extra file. Keeping your site updated also prevents it from Security attacks.
  • If you are running plugins that use older jQuery code, it’s probably better to update them or switch to an alternative kept updated.

How to remove jQuery migrate from WordPress?

Removing jQuery migrate from WordPress is quite easy. You just need to add the following lines of code to your theme’s function.php file.

//Remove JQuery migrate
 function 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' ) );
 }
 }
 }
 
 add_action( 'wp_default_scripts', 'remove_jquery_migrate' );

Another easiest way to disable it by adding a plugin named Remove jQuery Migrate.

Remove jQuery Migrate:

This plugin removes the jQuery Migrate script from the front end of your site.

  • Go to Dashboard >> Plugins >> Add New.
  • Search for Remove jQuery Migrate
  • Click Install Now
  • Activate the plugin

And, that’s it. The plugin will do the rest of your work.

This is a foremost used plugin that most of the developers suggest. There are also other plugins available that you can prefer.

Conclusion:

As I mentioned above, jQuery migrate adds unnecessary load to your site. Thus, I recommend removing it from your website or blog.

Also, read: Speed Up WordPress Performance

Is this article helpful? Let me know in the comment section below.

ALSO READ

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.

3 COMMENTS

  1. Never mind! I’ve created this and it works 🙂
    function remove_jquery_migrate_in_admin() {
    global $wp_scripts;
    $wp_scripts->remove(‘jquery’); // Remove default (because of jQuery Migrate dependency).
    $wp_scripts->remove(‘jquery-migrate’); // Prevent jQuery Migrate from being enqueued.
    $wp_scripts->add(‘jquery’, false, array(‘jquery-core’), ‘1.2.1’); // Add jQuery without jQuery Migrate.
    }
    add_action(‘admin_enqueue_scripts’, ‘remove_jquery_migrate_in_admin’);

LEAVE A REPLY

Please enter your comment!
Please enter your name here

GET STARTED

Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...

DEALS

MonsterInsights

MonsterInsights is the best Google Analytics plugin for WordPress. Setup Google Analytics for WordPress with just a few clicks.

POPULAR NOW

How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated...

Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys today one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

Xperia Home Launcher: Install on any Android Device (No Root)

Hey, guys today through this tutorial you are going to learn how to install Xperia Home Launcher on any Android device without any root. Also...

How to Display Featured Image Before or After Entry Title in Genesis

Learn how to add featured image to a single post or a page in Genesis child themes. You can set it to display featured...

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.