delete_user_meta : how to delete all the metadata of a given user (witout SQL)

on a multisite I delete a user with:

wpmu_delete_user($user_id);

Fine, but unless I am confusing, it doesn’t delete the metadata which may exist for this user…

delete_user_meta() seems to be the function to do this but I don’t see how to delete ALL the metadata, without entering the metakeys.
(I wanted to avoid writing a DELETE query directly on wp_usermeta table)

Thanks for your help
Pierre

Solutions Collecting From Web of "delete_user_meta : how to delete all the metadata of a given user (witout SQL)"

Yes, it does delete the usermeta. Here’s the code it uses:

$meta = $wpdb->get_col( $wpdb->prepare(
                      "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
foreach ( $meta as $mid )
    delete_metadata_by_mid( 'user', $mid );

There’s identical code in wp_delete_user (for the non-multisite case) and they use the same pattern for deleting taxonomy metadata, post metadata etc. so this seems to be the accepted way, without a direct DELETE.