remove jquery wp

  1. Access your WordPress admin dashboard.
  2. Navigate to the "Appearance" section and click on "Theme Editor."
  3. Locate the "functions.php" file on the right side of the editor.
  4. Add the following code at the end of the "functions.php" file:
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');
  1. Save the changes.

Note: This code snippet removes the jQuery Migrate script dependency from the registered jQuery script in WordPress. It ensures that the jQuery Migrate script is not loaded unless explicitly required, helping to minimize unnecessary script loading and improve overall performance.