wp user meta <command>

Adds, updates, deletes, and lists user custom fields.

In this article

Examples

# Add user meta
$ wp user meta add 123 bio "Mary is an WordPress developer."
Success: Added custom field.

# List user meta
$ wp user meta list 123 --keys=nickname,description,wp_capabilities
+---------+-----------------+--------------------------------+
| user_id | meta_key        | meta_value                     |
+---------+-----------------+--------------------------------+
| 123     | nickname        | supervisor                     |
| 123     | description     | Mary is a WordPress developer. |
| 123     | wp_capabilities | {"administrator":true}         |
+---------+-----------------+--------------------------------+

# Update user meta
$ wp user meta update 123 bio "Mary is an awesome WordPress developer."
Success: Updated custom field 'bio'.

# Delete user meta
$ wp user meta delete 123 bio
Success: Deleted custom field.

Subcommands

NameDescription
wp user meta add

Adds a meta field.

wp user meta delete

Deletes a meta field.

wp user meta get

Gets meta field value.

wp user meta list

Lists all metadata associated with a user.

wp user meta patch

Update a nested value for a meta field.

wp user meta pluck

Get a nested value from a meta field.

wp user meta update

Updates a meta field.

Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.