Add Profile Fields to WordPress User Form with Code

Posted on Posted in WordPress

The WordPress user profile allow you to set values for social services that you want to use. But it can often be some of the actual services such as facebook, twitter or googlepus are not included in the user profile. Adding profile form fields can be done with a code, no plugin required. Create a function which will accept an array of profile keys and values:

function modify_contact_methods($profile_fields) {

	// Add new fields
	$profile_fields['facebook'] = 'Facebook URL';
        $profile_fields['facebook'] = 'Facebook URL';
	$profile_fields['googleplus'] = 'Google+ URL';
	return $profile_fields;
}
add_filter('user_contactmethods', 'modify_contact_methods');

Put this function in Theme Functions (functions.php) on the main theme or child theme and you will get the required fields in your profile form.

Rada Arshinkovska

I create modern, high quality, responsive search engine friendly websites, beautifully crafted for my client needs and wishes. I build websites for individuals, businesses and organizations that have never had one, but also, for those who need help with redesigning their websites.

One thought on “Add Profile Fields to WordPress User Form with Code

Leave a Reply

Your email address will not be published. Required fields are marked *

16 − four =