skip to Main Content
How To Upgrade WordPress JQuery Version

How to upgrade WordPress jQuery version

WordPress uses an old version of jQuery. By default, WordPress uses an old version of jQuery but WordPress allows us to upgrade WordPress jQuery version. We can upgrade the jQuery Using the wp_enqueue_script function. We can replace the old jQuery version using wp_enqueue_script function. Let’s see how we can upgrade the new version of jQuery in WordPress.

Upgrade WordPress jQuery version

We are going to learn how to upgrade the jQuery version of WordPress using the hook. First of all, We remove the old version of jQuery and replace it with the new version of jQuery like.

function thecodingstuff_upgrade_jquery_version() {
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', "https://code.jquery.com/jquery-3.1.1.min.js", array(), '3.1.1' );
}
add_action( 'wp_enqueue_scripts', 'thecodingstuff_upgrade_jquery_version' );

wp_deregister_script

The wp_deregister_script function removes the old version of jQuery in WordPress.

wp_register_script

The wp_register_script function will help to replace the old version of jQuery with the new version.

Finally, We are ready with the latest version of the jQuery. Now, the latest jQuery features are worked.

Still, If you face any issue with an upgrade the jQuery version of WordPress writes the comment below.

Saroj

I am a web designer and developer part-time blogger. Write something on some free time. Find my every day thought here :)

Leave a Reply

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

Back To Top