WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a script that is based on jQuery, so I'm not enqueue-ing jQuery directly, but via passing it in the array of dependent scripts:

 wp_enqueue_script("jquery-plugin-name",'http://hostname.il/blogname/wp-content/themes/twentyten/js/jquery-plugin-name.js', array('jquery'), '1');

This is loading jQuery v1.4.4, and it weighs 76kb, which seems very heavy, although the file looks compressed.

I have 2 questions:

  1. Is there I way in which I can make it load the latest version of jQuery?
  2. How can I make sure that the loaded file if minified?
share|improve this question
up vote 1 down vote accepted

That's the size of the minified jQuery nowadays :)

You can load the latest from Google:

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 WordPress 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.

share|improve this answer
Don't forget to conditionally exclude this from admin area, it uses jQuery a lot and doesn't like it swapped for another version. – Rarst Jun 29 '11 at 10:46
Thanks. But how come this site has a much smaller jQuery file? – Lea Cohen Jun 29 '11 at 10:57
It's older version. I wouldn't say it's much smaller, 10-15K? – onetrickpony Jun 29 '11 at 11:02
@One, From what I see with JSView, the jQuery in WPSE is version 1.5.2 (mine is 1.4.4), and it weighs 29kb as opposed to my 76 kb. Thanks – Lea Cohen Jun 29 '11 at 11:14
it's the same size, but the server probably serves it compressed – onetrickpony Jun 29 '11 at 11:18

Do not modify the version of jQuery enqueued by WordPress.

Just don't do it. Core depends on a specific version. Themes and Plugins depend on a certain version. That certain version is the version bundled with a given version of WordPress.

If you need to perform script minification, compression, or concatenation, you can certainly do that (you can roll your own, or use a Plugin, such as W3 Total Cache, to do it for you.)

But as you can see: if you're got a 46kB file, you're already dealing with some combination of minification and compression.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.