4

I want to export a CSV file with a list of my Wordpress site users with WP-CLI. I can do this but I'm getting my users first and lastname together in one column (display name), I would like to get them each in their own column. Is there a way to do this? I can't find first and lastname as available options in the docs that lists optional fields.

1 Answer 1

4

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.

0

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.