# Remove jQuery Migrate on the Front End

> Drops the jQuery Migrate compatibility script from public pages. Only use it when your theme and plugins work with current jQuery.

- Type: PHP
- Runs: Run everywhere
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, jquery, scripts
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-jquery-migrate/

## Code

```php
add_action( 'wp_default_scripts', function ( $scripts ) {
    if ( is_admin() || empty( $scripts->registered['jquery'] ) ) {
        return;
    }

    $scripts->registered['jquery']->deps = array_diff( $scripts->registered['jquery']->deps, array( 'jquery-migrate' ) );
} );
```

## Notes

Check the browser console for jQuery errors after enabling.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove jQuery Migrate on the Front End" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
