In my wp_usermeta table I have a field called "wp_s2member_custom_fields"

In it is stored this value:


I am trying to use:

update_user_meta( $team_member_id, wp_s2member_custom_fields, $meta_value)

To update "donations_collected" from 10 to 11.

What should I put in $meta_value?

1 Answer 1


Thats just PHP serialized array notation. You would get that same result by this code:

$meta_value = array(
    'alumni' => 'Yes',
    'donations_collected' => '10'

update_user_meta( $team_member_id, 'wp_s2member_custom_fields', $meta_value);

So if you want to then change the donations_collected value to 11:

$meta_value = get_user_meta( $team_member_id, 'wp_s2member_custom_fields', true );    
update_user_meta( $team_member_id, 'wp_s2member_custom_fields', $meta_value);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.