WordPress how to get all user meta data by user ID?

how to get all user meta data by user ID in WordPress?

Related posts

Leave a Reply

6 comments

  1. @Boopathi Rejan nearly had it. Output all of the user meta by using the following code and then look through and find the values you

     $user_info = get_user_meta($current_user->ID);
     var_dump($user_info);
    

    You can change the USERID to anything, currently this is setup to display the ID of the logged in user.

  2. <?php
    $current_user = wp_get_current_user();
    echo 'Username: ' . $current_user->user_login . '<br />';
    echo 'User email: ' . $current_user->user_email . '<br />';
    echo 'User first name: ' . $current_user->user_firstname . '<br />';
    echo 'User last name: ' . $current_user->user_lastname . '<br />';
    echo 'User display name: ' . $current_user->display_name . '<br />';
    echo 'User ID: ' . $current_user->ID . '<br />';
    ?>