Function: delete_user_setting

delete_user_setting( string $names )

Delete user interface settings.

Shortcut: dus

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

Deleting settings would reset them to the defaults.

This function has to be used before any output has started as it calls setcookie().


Name Type(s) Default Value Description
$names string

The name or array of names of the setting to be deleted.


boolean | null

True if deleted successfully, false if not. Null if the current user can't be established.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.