function delete_user_setting( $names ) {}

Delete user interface settings.
Deleting settings would reset them to the defaults. This function has to be used before any output has started as it calls setcookie().


  • mixed $names: The name or array of names of the setting to be deleted.

Return values

returns:true if deleted successfully/false if not.

Source code

function delete_user_setting( $names ) {

	if ( headers_sent() )

		return false;

	$all = get_all_user_settings();

	$names = (array) $names;

	foreach ( $names as $name ) {

		if ( isset($all[$name]) ) {


			$deleted = true;



	if ( isset($deleted) )

		return wp_set_all_user_settings($all);

	return false;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: