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

Function Reference/delete usermeta

← Return to function reference.

This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.


This function is deprecated as of Version 3.0. Please use delete_user_meta instead.

Removes a user meta record from the wp_usermeta database table for a specific user ID.


 <?php delete_usermeta$user_id$meta_key$meta_value ); ?> 


(integer) (required) The ID of the WordPress user
Default: None
(string) (required) The meta_key field value
Default: None
(string) (optional) The meta_value field value; if omitted, the key is deleted regardless of value
Default: None

Return Values

  • True if deletion completed.
  • False if user_id is not a number.


<?php if (delete_usermeta(7'first_name')) {
'User meta key successfully removed!';
} else {
'User meta record could not be removed!';

Change Log

Since: 2.0.0

Source File