function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {}

Update user meta field based on user ID.
Use the $prev_value parameter to differentiate between meta fields with the same key and user ID.


  • int $user_id: Post ID.
  • string $meta_key: Metadata key.
  • mixed $meta_value: Metadata value.
  • mixed $prev_value: Optional. Previous value to check before removing.

Return values

returns:False on failure, true if success.

Source code

function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {

	return update_metadata('user', $user_id, $meta_key, $meta_value, $prev_value);



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: