What Is jQuery Migrate in WordPress, and When Can You Safely Remove It?

Date:

WordPress quietly loads an extra JavaScript file called jQuery Migrate on most sites. It’s a compatibility crutch for old code: useful while you need it, dead weight once you don’t. Here’s how to tell which, and how to remove it safely.

The short answer: jQuery Migrate is a small compatibility library that lets old jQuery code keep working on new jQuery versions. WordPress ships it as a bridge so themes and plugins written for older jQuery don’t break after an update. You can tell whether you still need it from the browser console: if you see JQMIGRATE deprecation warnings, something on the page relies on outdated jQuery, so keep Migrate and fix that code first. If the only message is JQMIGRATE: Migrate is installed (no warnings), nothing needs it, and you can remove it for a small performance win (one fewer script to load).

WordPress relies heavily on jQuery for interactive features, and jQuery has moved on over the years, dropping APIs that old themes and plugins still call. jQuery Migrate is the jQuery team’s answer to that: a shim that restores the removed/changed behavior so legacy code keeps running while its authors catch up (jQuery’s own upgrade guide documents the deprecations it covers). It’s meant to be temporary, a bridge, not a permanent dependency.

Do you still need jQuery Migrate? Ask the consoleThe console reading, not guesswork, decides whether removal is safe
1 · Read the console

Front end (not wp-admin), F12, reload. Look at the JQMIGRATE messages on your key templates.

2 · Warnings? Keep + fix

JQMIGRATE deprecation warnings = outdated jQuery still in use. Keep Migrate; update that theme/plugin first.

not safe yet
3 · Quiet? Safe to remove

Only "Migrate is installed", no warnings = nothing needs it. Dequeue it; drop one front-end script.

What jQuery Migrate actually does

When jQuery releases a new major version, it removes or changes methods that were deprecated in earlier releases. Any theme or plugin still calling those old methods would break. jQuery Migrate patches the newer jQuery at runtime to restore that old behavior, and, helpfully, logs a warning to the console each time something uses a deprecated feature, so you can find and fix it.

So Migrate plays two roles at once: it keeps old code working, and it tells you which code is old.

jQuery Migrate is a bridge you’re meant to walk off — it keeps old code alive and, at the same time, points at exactly what to fix.

Why WordPress still loads it

As WordPress core and plugins adopt newer jQuery, sites with older themes or plugins would hit compatibility breaks. Shipping Migrate by default means those sites keep functioning through the transition instead of throwing errors. The trade-off is one extra JavaScript file (jquery-migrate.js) loaded on your front end: small, but not free, and pure overhead once nothing actually needs it.

How to check whether you still need it

Don’t guess — read the console:

  1. Open your site’s front end (not wp-admin) in a browser.
  2. Open the developer console (F12) and reload.
  3. Look at the JQMIGRATE messages: – Deprecation warnings (e.g. “JQMIGRATE: jQuery.fn.attr(‘value’)… is deprecated”) mean something on the page still uses outdated jQuery. Keep Migrate and fix or update that theme/plugin first. – Only JQMIGRATE: Migrate is installed with no warnings means nothing on the page relies on deprecated features, so it’s safe to remove.

Check your important template types (home, a post, an archive, a page with forms or sliders), since different templates load different scripts.

When to remove it

Remove jQuery Migrate once all of these are true:

  • You’ve updated themes and plugins and reviewed custom code for deprecated jQuery.
  • The console shows no JQMIGRATE deprecation warnings on any key template.
  • You want the small performance gain of dropping one render-path script.

If any deprecation warning remains, leave Migrate in place and fix the offending code first. Removing the bridge while something still stands on it is how you get subtly broken sliders, menus, and form scripts.

Remove the bridge only after the console is quiet — pull it while something still needs it and menus and sliders break in ways that are hard to trace.

How to remove it safely

Once the console is clean, dequeue Migrate with a small snippet — a code-snippets plugin, a site-specific plugin, or your theme’s functions.php:

// Remove jQuery Migrate (front end only) once no JQMIGRATE deprecation warnings remain.
function 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', 'remove_jquery_migrate' );
Code language: PHP (php)

The ! is_admin() guard is deliberate: it leaves Migrate active in wp-admin (where the editor and many plugins still expect it) and removes it only on the front end, where your visitors are. Since this is one small, focused change, it’s a textbook case for a snippet rather than a plugin. After adding it, reload the front end and confirm jquery-migrate.js is gone and nothing broke, then re-run your key templates once more.

The short version

jQuery Migrate is a compatibility bridge WordPress loads so old jQuery code survives newer jQuery versions. Whether you still need it is a console question, not a guess: JQMIGRATE deprecation warnings mean something outdated is still in use, so keep Migrate and fix that code; only JQMIGRATE: Migrate is installed with no warnings means it’s safe to remove. Removing it drops one front-end script for a small speed gain, done cleanly with a wp_default_scripts snippet that dequeues it on the front end only. Fix the deprecated code first; pull the bridge second.

Frequently Asked Questions

Should I remove it in wp-admin too?

No. Leave Migrate active in the admin, where the block editor and many plugins still expect it. The safe snippet removes it on the front end only (! is_admin()), which is where the visitor-facing performance gain is.

What if something breaks after I remove it?

Disable the snippet and reload: Migrate comes straight back and the broken script should work again. Then check the console on that template for JQMIGRATE warnings, which usually only show up on a page you didn’t check the first time. Fix or update the theme or plugin they point to before you remove Migrate again.

The warnings come from a plugin I can’t fix. What now?

Keep Migrate. Check for an update first, since the author may already have replaced the deprecated calls. If there is none, ask the author or look for a maintained alternative. Until then, the one extra script costs far less than a broken menu, slider or form.

Share post:

Subscribe

Popular

More like this
Related

WooCommerce Search by SKU or ISBN Finds Nothing? It Never Looks There

A shopper types the SKU from your catalog, or the ISBN printed on the back of a book, and gets "No products were found". The product is right there, and the number is on its page. Search simply never reads that part of the product.

Computer Slow but CPU and Memory Look Normal? Check the Handle Count

Chrome takes a minute to open, or doesn't open at all. Every click waits. You open Task Manager expecting to find the culprit, and it tells you everything is fine. Here is the number that isn't, and the fix that takes two minutes.

Kernel-Power 41 Tells You Your PC Restarted, Not Why

Your PC restarts with no blue screen, and the only clue is a critical event saying it didn't shut down cleanly. Here is how to get from that event to a short list of suspects.

Set Up WordPress SMTP Without a Plugin, Even on a Multisite Network

WordPress mail goes out as wordpress@ your domain, from the web server, and lands in spam. An SMTP plugin fixes that. So do about twenty lines of code, and on a network of sites the code can give every site its own mailbox and its own password.