Add Additional Custom Column to the WordPress Users Table

To add additional custom field on Wp-admin side Users listing table add following code in your active theme functions.php file.
Dont forgot to update column name Meta key according it used in your functionality for get user additional details.

Add Additional Input field to User Profile page Wp-admin side

/* start Back end extra User profiel field */
add_action( 'show_user_profile', 'extra_user_profile_fields' );
add_action( 'edit_user_profile', 'extra_user_profile_fields' );
add_action( "user_new_form", "extra_user_profile_fields" );

function extra_user_profile_fields( $user ) { 
$ls_user_type = get_the_author_meta( 'ls_user_type', $user->ID);


<?php } add_action( 'personal_options_update', 'save_extra_user_profile_fields' ); add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' ); add_action( 'user_register', 'save_extra_user_profile_fields' ); function save_extra_user_profile_fields( $user_id ) { if ( !current_user_can( 'edit_user', $user_id ) ) { return false; } update_user_meta( $user_id, 'ls_user_type', $_POST['drd_user_type'] ); } //
Scroll to Top