Performance PHP Beginner

Remove jQuery Migrate on the Frontend

Last updated: May 6, 2026

WordPress bundles jQuery Migrate alongside jQuery itself. jQuery Migrate is a compatibility shim that restores deprecated jQuery APIs removed in jQuery 3.x, allowing older plugins and themes written for jQuery 1.x to continue working without updates. On sites running modern, well-maintained themes and plugins, jQuery Migrate provides no value, it’s a ~9KB script that every visitor downloads and executes for no practical benefit.

The Code

Add this to your functions.php or a site-specific plugin. This approach removes the dependency at the script registration level rather than dequeuing the script after the fact, which is more reliable.

How WordPress Loads jQuery

WordPress registers jQuery as a bundle that depends on jquery-migrate. When anything enqueues jquery, WordPress automatically loads both jquery-core and jquery-migrate as its dependencies. The snippet removes jquery-migrate from jQuery’s dependency list, so enqueuing jQuery loads only the core library going forward.

Testing Before Committing

Before applying this permanently, test your site thoroughly, check the browser console for JavaScript errors on every major page type: homepage, blog, product pages, cart, checkout, and any page with interactive elements. jQuery Migrate outputs console warnings when deprecated methods are called; if you’ve already seen those warnings and addressed them (or never seen them), removing Migrate is safe. If you see new errors after removal, a plugin or theme is still using deprecated jQuery APIs and needs updating before Migrate can be removed.

Admin Is Excluded

The ! is_admin() check ensures jQuery Migrate remains available in the WordPress admin. The admin interface and some plugins depend on it in the backend context. Removing it from the admin can break the block editor, meta boxes, and various admin UI components. The performance benefit on the frontend is the target, admin is deliberately left untouched.

Long-Term Outlook

WordPress has been on a multi-year path to drop jQuery Migrate from the default frontend bundle. Each major WordPress release has encouraged plugin and theme developers to remove their jQuery 1.x dependencies. If your plugins are regularly updated and your theme is modern, the ecosystem around your site is likely already Migrate-free in practice, this snippet just makes it official.

functions.php
add_action( 'wp_default_scripts', function( $scripts ) {
    if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
        $jquery_deps = $scripts->registered['jquery']->deps;
        $scripts->registered['jquery']->deps = array_diff(
            $jquery_deps,
            [ 'jquery-migrate' ]
        );
    }
} );

Built by Nahnu Plugins

Need something more powerful than a snippet?

Our commercial plugins go further, built for serious WordPress sites with full support, updates, and documentation included.

Browse All Plugins →

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only