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

Wordpress has wp_enqueue_script() but not a wp_dequeue_script() function, so what would be the best way to dequeue a script? I'm using LAB.js to load all of my scripts rather than enqueueing them server side, so I don't want plugins running around adding jQuery 10 times when I'm already loading it.

Would using wp_deregister_script( 'jquery' ) accomplish the same purpose?

share|improve this question
up vote 12 down vote accepted

There is a dequeue method available ... I'm just not sure why it isn't wrapped in a wp_dequeue_script() method. (I might create a ticket for this issue, actually)

But yes, using wp_deregister_script will accomplish what you're trying to do. Just remember, if you ever do want to use WP's built-in jQuery later you'll need to re-queue it first.

share|improve this answer
If anyone's keeping score, the Trac ticket is here: core.trac.wordpress.org/ticket/14815 – EAMann Sep 8 '10 at 18:39
Update: The function wp_dequeue_script() will be included in the next release of WordPress. To "un-enqueue" a script like jQuery, you'd just call wp_dequeue_script('jquery'). This is changeset 15601: core.trac.wordpress.org/changeset/15601 – EAMann Sep 9 '10 at 16:07

Since WordPress 3.1 there is actually a wp_dequeue_script() function available.

share|improve this answer
That function exists because of this question :) – Dan Gayle Mar 14 '12 at 23:39
Cool, just used it today :) – Borek Mar 15 '12 at 0:11

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.