Export list of users with first and lastname in WP-CLI

According to the documentation for wp user list, the fields argument accepts any valid WP_User_Query field.

Thus, you can simply use wp user list --fields=first_name,last_name --format=csv to list all users with their first and last names. Of course you can add any other fields that you need.

Note: You can get the documentation for each command using the --help flag, where things like that are mentioned.

Leave a Comment