Update the core jQuery version that ships with WordPress

You can replace the default version that ships with WordPress like that:

function replace_core_jquery_version() {
   function replace_core_jquery_version() {
    wp_deregister_script( 'jquery-core' );
    wp_register_script( 'jquery-core', "https://code.jquery.com/jquery-3.4.1.min.js", array(), '3.4.1' );
    wp_deregister_script( 'jquery-migrate' );
    wp_register_script( 'jquery-migrate', "https://code.jquery.com/jquery-migrate-3.1.0.js", array(), '3.1.0' );
}
add_action( 'wp_enqueue_scripts', 'replace_core_jquery_version' );

Leave a Reply

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