WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp dequeue script

Description

Remove an enqueued script.

To be dequeued, the script must have been enqueued. Attempting to dequeue a script before the script is enqueued will have no effect.

Usage

<?php wp_dequeue_script$handle ); ?>

Parameters

$handle
(string) (required) The slug of the script to dequeue
Default: None

Examples

Dequeue a script.

/**
 * Dequeue the jQuery UI script.
 *
 * Hooked to the wp_print_scripts action, with a late priority (100),
 * so that it is after the script was enqueued.
 */
function wpdocs_dequeue_script() {
   wp_dequeue_script( 'jquery-ui-core' );
}
add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );

Change Log

Since: 3.1

Source File

wp_dequeue_script() is located in wp-includes/functions.wp-scripts.php

Related

Enqueue Styles

Enqueue Scripts

Front-End Hooks

Admin Hooks

Login Hooks

See also index of Function Reference and index of Template Tags.