The Wild

Remove jQuery Migrate from WordPress

· 5 min read · Mammals

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Removing jQuery Migrate from WordPress can speed up your site by eliminating a legacy JavaScript file that many themes and plugins no longer need. This guide shows you how to safely disable it, either with a code snippet or a plugin, while keeping your site functional.

What You'll Need

  • Access to your WordPress admin dashboard (to install a plugin or add code).
  • FTP or cPanel File Manager access (if you prefer to edit your theme's functions.php file directly).
  • A child theme (recommended) so your changes aren't lost when the parent theme updates.
  • A backup of your site (files and database) before making any changes.

Step-by-Step

  1. Check if jQuery Migrate is actually loaded. Open your site's front end in a browser, right-click and select "View Page Source" (or use DevTools). Search for jquery-migrate.min.js or jquery-migrate.js. If you don't find it, you don't need to do anything—skip the rest. If you do see it, continue.
  2. Identify what's loading it. jQuery Migrate is usually loaded by WordPress core (for older themes/plugins) or by a specific theme/plugin. To see which, you can use a plugin like "Query Monitor" or check your theme's functions.php and any plugin files for wp_enqueue_script calls that include jquery-migrate.
  3. Test your site after disabling it (recommended before permanent removal). The safest way is to use a plugin that lets you disable jQuery Migrate temporarily. Install and activate "jQuery Migrate Helper" (by the WordPress core team) and set it to "Test with jQuery Migrate disabled." This logs any errors on the console and shows you if your theme/plugins rely on old jQuery features.
  4. If the test shows no errors, disable jQuery Migrate permanently. You have two options:
  5. Option A: Use a plugin. Install and activate "Disable jQuery Migrate" (or a similar plugin). This plugin removes the jQuery Migrate script from your front end. No configuration needed—it works out of the box.
  6. Option B: Add a code snippet to your theme's functions.php. If you prefer code, add the following to your child theme's functions.php file (or via a code snippets plugin):
    add_action( 'wp_default_scripts', 'remove_jquery_migrate' );
    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' ) );
            }
        }
    }
    This code removes the dependency on jQuery Migrate from the front end only.
  7. Clear any caching. If you use a caching plugin (like WP Rocket, W3 Total Cache, or a CDN), clear all caches so the updated script files are served.
  8. Verify the removal. Reload your site and check the page source again—jquery-migrate should be gone. Also check your browser console (F12) for any JavaScript errors.

Common Mistakes

  • Removing jQuery Migrate without testing. Some older plugins or custom code rely on deprecated jQuery methods that Migrate provides. Removing it blindly can break sliders, forms, or menus.
  • Editing the parent theme's functions.php directly. If you do this, your changes are lost when the theme updates. Always use a child theme or a code snippets plugin.
  • Disabling jQuery Migrate in the admin area. Some admin pages might still need it. The code above only disables it on the front end, which is usually safe.
  • Forgetting to clear caches. Even after removing the script, your browser or caching plugin may still serve the old version. Always purge caches.

Tips

  • Use a plugin like "Query Monitor" to see exactly which scripts are loaded on each page—this helps you confirm the removal and spot any other performance issues.
  • Test on a staging site first. If possible, duplicate your site to a staging environment and test the removal there before applying it to production.
  • Keep your theme and plugins updated. Modern themes and plugins no longer need jQuery Migrate. Updating them reduces the risk of breakage.
  • If you see errors after removal, you can re-enable jQuery Migrate temporarily while you update the problematic plugin or theme.

Troubleshooting

What if my site breaks after removing jQuery Migrate? If you see JavaScript errors or features stop working, re-enable jQuery Migrate (either by deactivating the plugin or removing the code snippet). Then, investigate which plugin or theme code is using deprecated jQuery features. You may need to update that plugin/theme or contact its developer.

What if jQuery Migrate still appears after removal? This means something else is loading it—likely a plugin or theme that explicitly enqueues it. Search your theme's files and all plugin files for "jquery-migrate" using a code search plugin or FTP. You can also use a plugin like "Asset CleanUp" to dequeue it manually.

What if I see a 404 error for jquery-migrate.min.js? This can happen if a plugin or theme references the file but it's not actually loaded. It's harmless, but you can ignore it or find the reference and remove it.

What if the page loads but my slider or menu is broken? This is a classic sign that your theme/plugin relies on deprecated jQuery methods. Re-enable jQuery Migrate and update the theme/plugin. If no update is available, you may need to keep Migrate enabled for that component.

Frequently Asked Questions

Is it safe to remove jQuery Migrate from WordPress?

Generally yes, if your theme and plugins are modern and don't use deprecated jQuery features. Test first—if no errors appear, it's safe.

Why does WordPress load jQuery Migrate?

WordPress includes it for backward compatibility with older themes and plugins that use deprecated jQuery APIs. It's not required for newer code.

Will removing jQuery Migrate speed up my site?

It can, by reducing one HTTP request and a small amount of JavaScript (about 30KB). The impact is minor but can add up on slow connections.

Can I remove jQuery Migrate without a plugin?

Yes, you can add the code snippet provided above to your theme's functions.php or a code snippets plugin.

What if my theme or plugin requires jQuery Migrate?

If you see errors after removal, you need to keep it enabled for that component. You can selectively load it only on pages where it's needed, but that's more advanced.

Does removing jQuery Migrate affect the admin dashboard?

No, the code snippet only disables it on the front end. The admin area remains unchanged.