Apps Ballance Cash_2 Chat Checkout Click Code Cog_Wheels Compose_email Conference Contacts Earth Edit_File_1_ Email Email_2 File Folder_2 Gift Group Group_2 Help ID ID_2 Key Keys Laptop_Store Like_1_ Link Lock Log_Out Map Marketing Mobile_UI Navigation POS Partnership Profile Safe_2 Search_User Secure_Files Settings Share Shield Shield_2 Shopping_Cart Support_Male Trash Type_pin User_female User_male logo copy

What is the field meta key option

Iain Poulson avatar
Iain Poulson Last updated on March 6, 2021

If you’re just getting started with meta fields in WordPress, check out our tutorial on how to set up WordPress custom user meta fields.

The support for custom fields for users in WordPress is limited and it isn’t possible to define new custom fields without a plugin like
WP User Manager. WP User Manager, with the Custom Fields addon allows site admins to define custom user meta (such as phone number, address, employment details) that they can add to user registration forms to collect data from users, as well as being displayed on the user profiles.

WP User Manager is one of the most straightforward to use WordPress membership plugins available, with a large number of
features that turn your WordPress site into a membership platform.

Custom Fields

Every field has a “unique meta key” setting that must be filled. This is automatically created for you when you create the field. The meta key determines how the field will be stored into the database of your website. If you do not need to do any custom development you probably do not need to customize this field.

It’s important however that if you change the key, it has to be a unique value that no other field has. Using the same key for multiple fields will make it impossible for the user to correctly update it’s information.
Developers however can freely customize this setting if they know what they’re doing. The metakey is used to retrieve the saved value from the database and display it. 
If you are a developer, chances are you already know about this WordPress function 
https://codex.wordpress.org/Function_Reference/get_user_meta.
This function is used to retrieve the value of a user custom field from the database through the user id number and the metakey name.
In WPUM every custom field metakey has the prefix “wpum_”.
Note: the prefix for file fields is “wpum_file_”.

This means that the full metakey name is wpum_field_11. If you change that to anything else like “job_title”, the metakey will be wpum_job_title.

Here you can find an example of the get_user_meta function retrieving a WPUM field value.

get_user_meta( $user_id, 'wpum_field_11', true );

OR, if the above does not work:

carbon_get_user_meta( $user_id, 'wpum_field_11' );

Get started adding custom fields to your WordPress users.

WP User Manager logo

Get Started with the Best WordPress Membership Plugin Today

Connect, Manage and Build your Membership Site

Need more help?

If you still didn't find an answer you can always contact us

Submit a ticket