Add and delete user profile contact info in your WordPress dashboard. Remove AIM, Jabber, Yahoo IM using $contactmethods. Add Twitter, Facebook, etc.

Add and Delete User Profile Contact Info in WordPress

Written by in Tutorials |

WordPress Contact Info

WordPress Contact Info

A standard WordPress install has 5 fields under Contact Info: E-mail, Website, AIM, Yahoo IM and Jabber/Google Talk. It’s about damn time to remove the last 3, or at the very least add Facebook and Twitter since they seem to be the most-used method of contact for the vast majority of people on the web.

Adding the Code

Here’s a quick and easy way to do just that, add or delete user profile contact info from your WordPress dashboard. Add the following to your themes functions.php file (custom_functions.php for Thesis users):

//ADD/REMOVE USER PROFILE CONTACT INFO
function hide_add_contact_info( $contactmethods ) {
	unset($contactmethods['aim']);
	unset($contactmethods['jabber']);
	unset($contactmethods['yim']);
	$contactmethods['twitter'] = 'Twitter <span class="description">(username only)</span>';
	$contactmethods['facebook'] = 'Facebook <span class="description">(username only)</span>';
	return $contactmethods;
}
add_filter('user_contactmethods', 'hide_add_contact_info');

What it Means?

Let’s break this down a bit. The following is what removes AIM, Yahoo IM and Jabber/Google Talk from the Contact Info list:

	unset($contactmethods['aim']);
	unset($contactmethods['jabber']);
	unset($contactmethods['yim']);

The next bit of code adds the new Facebook and Twitter fields (you can add any fields you want):

	$contactmethods['twitter'] = 'Twitter <span class="description">(username only)</span>';
	$contactmethods['facebook'] = 'Facebook <span class="description">(username only)</span>';
	$contactmethods['yell'] = 'Yell <span class="description">(what name should we yell)</span>';

The rest returns the new list and hooks our new hide_add_contact_info function to the user_contactmethods filter:

	return $contactmethods;
}
add_filter('user_contactmethods', 'hide_add_contact_info');

User Profile WordPress Plugins

Here are a few plugins that are somewhat related to WordPress User Profiles:

  • WP Hide Dashboard — removes the Dashboard menu, the Personal Options section and the Help link on the Profile page, hides the Dashboard links in the admin bar menu (if activated), and prevents Dashboard access to users assigned to the Subscriber role.
  • User Photo — allows a user to associate a profile photo with their account through their “Your Profile” page.

Enjoy this post? Consider sharing it:

{ 2 comments… read them below or add one }

Les Dossey September 18, 2011

Jason,

That worked perfectly.

Only the Best,

Reply

Jason Manheim September 18, 2011

Awesome. Glad it helped.

Reply

Leave a Comment