wp_dequeue_script( string $handle )

Remove a previously enqueued script.


Description Description

See also See also


Top ↑

Parameters Parameters

$handle

(string) (Required) Name of the script to be removed.


Top ↑

Source Source

File: wp-includes/functions.wp-scripts.php

function wp_dequeue_script( $handle ) {
	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );

	wp_scripts()->dequeue( $handle );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Codex

    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 );
    

You must log in before being able to contribute a note or feedback.