Function: delete_user_option

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

Delete user option with global blog capability.

Shortcut: duo

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.

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 informed of new chapter releases, important WordPress API updates and more.