WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/delete user option

Description

Delete user metadata per site or network-wide.

User options are just like user metadata except that they have support for blog-specific options when using multisite. If the $global parameter is false, which it is by default, it will prepend the WordPress table prefix to the option name. This will delete the site-specific metadata for the user, rather than the network-wide metadata.

Usage

<?php delete_user_option$user_id$option_name$global ); ?>

Parameters

$user_id
(int) (required) User ID
Default: None
$option_name
(string) (required) User option name.
Default: None
$global
(boolean) (optional) Whether option name is global (network wide) or blog specific. Default is false (blog specific).
Default: false

Return Values

(boolean) 
True on successful delete, false on failure.

Notes

Change Log

Since: 3.0

Source File

delete_user_option() is located in wp-includes/user.php

Related

add_user_meta(), delete_user_meta(), get_user_meta(), update_user_meta(), get_user_option(), delete_user_option(), update_user_option(),