wp_deregister_script(‘jquery’) not working

I use this code:

if ( ! function_exists( ‘WPScripts_enqueue’ ) ) {
function WPScripts_enqueue() {

// Removing default jQuery
wp_deregister_script( ‘jquery’ );

// Enqueue the new jQuery
wp_enqueue_script(‘jquery’, ‘https://code.jquery.com/jquery-3.2.1.slim.min.js’, false, ‘3.2.1’, false);

// Enqueue custom Bootstrap file
wp_enqueue_style(‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap.css’, array(), false, ‘all’);

}
}
add_action(‘wp_enqueue_scripts’, ‘WPScripts_enqueue’);

however, wp still load jquery from wp core:

https://developers.google.com/speed/pagespeed/insights/?hl=TR&url=http%3A%2F%2Fwww.migrate2.deniz-tasarim.site%2Fhomepage%2F&tab=desktop

https://i.ibb.co/qxhCY6R/image.png

Read more here:: wp_deregister_script(‘jquery’) not working

Leave a Reply

Your email address will not be published. Required fields are marked *