Replace or Add User Profile Fields in WordPress

If you take into consideration that WordPress is the most widely used blogging platform, it is confusing why they are still living in the past.  I am referring to the usage of AIM, Jabber, and Yahoo in the user’s profile.  Currently, within WordPress, there is no way for you to modify these choices.  However, with a few simple lines of code in our functions.php file, we can bring WordPress into the 21st century.

Instead of AIM, Jabber, and Yahoo why not use Facebook, LinkedIn, and Twitter?  This would make more sense, wouldn’t it? Your choices are your own!  There are really two ways to tackle this.  First is replacing those mentioned, and second is just adding them to the list already.

Replacing AIM, Jabber, and Yahoo:

// --------------------------------------------------------------------------
// Start Replace User Profile Fields
// --------------------------------------------------------------------------
	function extra_contact_info($contactmethods) {
		unset($contactmethods['aim']);
		unset($contactmethods['yim']);
		unset($contactmethods['jabber']);
		$contactmethods['facebook'] = 'Facebook';
		$contactmethods['twitter'] = 'Twitter';
		$contactmethods['linkedin'] = 'LinkedIn';

		return $contactmethods;
	}
	add_filter('user_contactmethods', 'extra_contact_info');
// --------------------------------------------------------------------------
// Start Replace User Profile Fields
// --------------------------------------------------------------------------

If you want to just add those instead of replacing:

// --------------------------------------------------------------------------
// Start Add User Profile Fields
// --------------------------------------------------------------------------
	function my_new_contactmethods( $contactmethods ) {
	//Add Twitter
	$contactmethods['twitter'] = 'Twitter';
	//add Facebook
	$contactmethods['facebook'] = 'Facebook';
	//add LinkedIn
	$contactmethods['linkedin'] = 'LinkedIn';
	//add MySpace
	$contactmethods['myspace'] = 'MySpace';

	return $contactmethods;
	}
	add_filter('user_contactmethods','my_new_contactmethods',10,1);
// --------------------------------------------------------------------------
// End Add User Profile Fields
// --------------------------------------------------------------------------

Note: These functions are not of my own creation, simply things I have found along the way.  If you are the author of this function, please let me know so I can properly credit you with your work!

About Joe D

I have always had a passion for everything computing. In early 2000, I decided to take my passion to the web. Thus, C.O.D. was born. Through the years we have made many great friends at C.O.D. and hope to continue our journey for years to come.

Check Also

Manage Multiple WordPress Sites with InfiniteWP

Running your website, or websites, on WordPress is an easy choice as the flexibility the …

One comment

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.