Nothing like opening up a speed test for your WordPress site and seeing a complaint about too many scripts blocking the page, and among them, seeing jquery-migrate.
jQuery Migrate has been bundled in WordPress for a long time, and used to be important for keeping scripts using old jQuery syntax functional with new versions of jQuery bundled into WordPress.
But at some point, it’s just one more thing for WordPress maintainers to stay on top of to support an increasingly small number of plugins that, at this point, are decidedly abandoned if they’ve not updated to be compatible. So it’s been slated for removal for a while.
The History of Removing jQuery Migrate
Back in 2020, a plan was released to update the bundled version of jQuery with WordPress to 3.0, based on a trac ticket that, at this point, is a decade old. This originally included an upgrade to the bundled version of jQuery Migrate.
Steps 1 + 2 were achieved in WordPress 5.5—upgrade both jQuery and jQuery Migrate—but step 3, which was to remove jQuery Migrate altogether, never happened.
But the effort didn’t immediately die. Since then, a collection of patches—one written by yours truly—were made to WordPress core to ensure that at least core was not dependent on the old jQuery syntax.
The last commit related to the effort to drop jQuery Migrate was three years ago—two years after the original plan was published. There are not, to my knowledge, any remaining deprecation warnings in core thrown by jQuery Migrate. We were left with this comment:
Moving to Future Release for now, this can be put on a release milestone again when there is consensus about removing jQuery Migrate, as per the step 3 of the roadmap for updating jQuery to 3.x.
Today’s Status
Earlier this month, core contributor Aaron Jorbin fielded a question around this effort in the Making WordPress Slack, and proposed the following timeline:
- During wp 7.0 cycle – announce intent to remove migrate
- For WP 7.1 – Remove migrate
- For WP 7.2 – Upgrade jQuery
That conversation has been linked from the Trac ticket, but doesn’t really have a champion. The languishing of this task, as so many developer-friendly tasks around the most legacy parts of WordPress, is not wholly unsurprising. But maybe we’ll see this get some love!
Related: removing and upgrading tooling like this in nondescript releases like 7.1 and 7.2 impresses the need for SemVer-like versioning for WordPress core.
Removing jQuery Migrate Today
Frustratingly, jQuery Migrate is not just bundled with WordPress core, but is automatically enqueued anytime jQuery is enqueued (which is pretty much all scenarios). But if you trust that your dependencies don’t actually need Migrate, you can remove jQuery Migrate, and you can do it without a plugin! Here’s how:
<?php
// Remove jQuery Migrate dependency from jQuery
function remove_jquery_migrate( $scripts ) {
if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
$script = $scripts->registered['jquery'];
if ( $script->deps ) {
// Remove jQuery Migrate handle from jQuery dependencies array
$script->deps = array_diff( $script->deps, ['jquery-migrate'] );
}
}
}
add_action( 'wp_default_scripts', 'remove_jquery_migrate', 11 );Code language: PHP (php)

Leave a Reply