WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp dequeue script

Contents

Description

With no exception, this function is executed to dequeue the script that has been enqueued before, so the function has to be hooked to where WordPress prints scripts. if dequeue action is executed before the script is enqueued, the function will only eat up resources to no avail.

Usage

<?php wp_dequeue_script$handle ); ?>

Parameters

$handle
(string) (required) the script name to dequeue
Default: None

Examples

Dequeue a script.

add_action( 'wp_print_scripts', 'de_script', 100 );

function de_script() {
    wp_dequeue_script( 'jquery' );
    wp_deregister_script( 'jquery' );
}

Change Log

Since: 3.1

Source File

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

Related

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