Function: delete_user_option

delete_user_option( integer $user_id, string $option_name, boolean $global )

Delete user option with global blog capability.

User options are just like user metadata except that they have support for global blog options. If the 'global' parameter is false, which it is by default it will prepend the WordPress table prefix to the option name.

Parameters

Name Type(s) Default Value Description
$user_id integer

User ID

$option_name string

User option name.

$global boolean false

Optional. Whether option name is global or blog specific. Default false (blog specific).

Returns

boolean

True on success, false on failure.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.