How to control what jQuery version to include, with wp_enqueue_script

That’s the size of the minified jQuery nowadays 🙂

You can load the latest from Google:

wp_deregister_script('jquery');
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"), false, '1.8.2');

Please keep in mind that this can cause issues moving forward, as you are forcing WordPress to load a certain version of jQuery instead of the version bundled with it. There are plugins out there that may be better suited for your needs, like WP JQuery Plus, which make sure to load the same version number as WordPress does, but with the benefit of loading it from Google.

Leave a Comment