Is jQuery included in WordPress by default?

Yes, jQuery is part of WordPress core. But–it can become outdated, because jQuery updates can happen in between WP releases. The recent release of WordPress does use a very recent version of jQuery.

By default,

wp_enqueue_script('jquery') 

grabs jQuery from the core at /wp-includes/js/jquery/jquery.js.

The “correct” way to add jQuery to your WP site is:

function theme_scripts() {
  wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'theme_scripts');

Another catch–if you do use the latest jQuery, be careful that it doesn’t break plugins.

Leave a Comment