How to Add and Remove Fields from User Info Contact Fields

Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.

5 Flares Filament.io 5 Flares ×

One of the things I always thought was a little strange in WordPress was the limited and out dated contact fields for the user profiles. Seriously, who uses AIM and Yahoo anymore. I never used Yahoo Messenger, but I did use AIM and now I almost never use it and I don’t even have it installed on any of my systems. These older services are not as popular as they once were and like most, I connected with most of my instant messenger friends on services such as Facebook and Twitter.

With that in mind, I decided to figure out why WordPress hasn’t updated the user contact fields and find a way to update the code to add and remove fields as needed. I found nothing as to why they haven’t made those changes, but these fields are not that important and they are working on other more important issues (new features and bug fixes) with the code.

Since it looks like WordPress isn’t going to update these fields anytime soon, I decided to figure out how to update these fields myself. I found that it was easy to make these updates and its only a few lines of code added to the functions.php file.

How to Add and Remove Fields to User Contact Fields in WordPress

I decided to remove the AIM, and Yahoo IM and add Twitter, Facebook, and Google+. I ended up keeping Jabber/Google Talk is, because I still use Google Talk and the service is linked through the Google Profile. You can use the service when your email is up. So if someone wants to reach me that way they can. But in the near feature, I believe this field can be removed as well.  How to Add and Remove Fields to User Contact Fields in WordPress

The first thing you need to do is load up the editor by going to Admin >>> Appearance>>>Editor>>>Functions.php. Once the Functions.php is loaded, make sure to back up the file before making any changes.

Next, place the below code at the end of the functions.php file. If you place it at the end of the code, make sure to add the code before the ?> if your functions.php file has it. This code will remove the AIM, yahoo IM, and Jabber/Google Talk fields and add Twitter, Facebook, and Google+.
[php]
function extra_contact_info($contactmethods) {
unset($contactmethods[‘aim’]);
unset($contactmethods[‘yim’]);
$contactmethods[‘twitter’] = ‘Twitter’;
$contactmethods[‘facebook’] = ‘Facebook’;
$contactmethods[‘linkedin’] = ‘LinkedIn’;
$contactmethods[‘gprofile’] = ‘Google Plus Profile’;
return $contactmethods;
}
add_filter(‘user_contactmethods’, ‘extra_contact_info’);
[/php]
If you want to keep the default fields, then add this code instead.
[php]
function extra_contact_info($contactmethods) {
$contactmethods[‘twitter’] = ‘Twitter’;
$contactmethods[‘facebook’] = ‘Facebook’;
$contactmethods[‘linkedin’] = ‘LinkedIn’;
$contactmethods[‘gprofile’] = ‘Google Plus Profile’;
return $contactmethods;
}
add_filter(‘user_contactmethods’, ‘extra_contact_info’);
[/php]

Original Source of code came from and article from Web Froze. The code is basically the same, I just changed the order of how the contact fields display.

EvolutionaryDesigns.net runs on the Genesis Framework

Genesis Framework

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!


Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.

About James

James spends most of his free time using social media and loves to teach others about design, web development, CSS, SEO, and social media. He is addicted to Wordpress, social media, and technology. You can reach him on his, personal website, Do not forget to follow him on Twitter @element321

Comments

  1. Nice trick James! I’ll try it at my personal blog this evening. Thanks 🙂

  2. Thank you so much for posting the codes here. Surprisingly, you were able to slither your way out of the outdated contact details such as yahoo and aim. I’m also having some troubles with them at my end.

Leave a Reply

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

5 Flares Twitter 4 Facebook 1 Pin It Share 0 Buffer 0 Email -- Filament.io 5 Flares ×
%d bloggers like this: