Ready to get started?Download WordPress


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

Function Reference/delete user option


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.


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


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

Return Values

True on successful delete, false on failure.


Change Log

Since: 3.0

Source File

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


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