{"id":4124,"date":"2011-11-28T17:41:36","date_gmt":"2011-11-28T23:41:36","guid":{"rendered":"http:\/\/www.evolutionarydesigns.net\/blog\/?p=4124"},"modified":"2011-11-28T18:05:45","modified_gmt":"2011-11-29T00:05:45","slug":"add-remove-fields-user-info-contact","status":"publish","type":"post","link":"http:\/\/www.evolutionarydesigns.net\/blog\/2011\/11\/28\/add-remove-fields-user-info-contact\/","title":{"rendered":"How to Add and Remove Fields from User Info Contact Fields"},"content":{"rendered":"<p>One of the things I always thought was a little strange in <a href=\"http:\/\/www.wordpress.org\" target=\"_blank\">WordPress<\/a> 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\u2019t 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.<\/p>\n<p>With that in mind, I decided to figure out why WordPress hasn\u2019t 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\u2019t 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.<\/p>\n<p>Since it looks like WordPress isn\u2019t 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.<\/p>\n<h2>How to Add and Remove Fields to User Contact Fields in WordPress<\/h2>\n<p>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.&nbsp; <img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" style=\"display: block; float: none; margin: 10px auto; border: 0px;\" title=\"How to Add and Remove Fields to User Contact Fields in WordPress\" src=\"https:\/\/i0.wp.com\/www.evolutionarydesigns.net\/blog\/wp-content\/uploads\/2011\/11\/contactinfo.png?resize=604%2C355\" alt=\"How to Add and Remove Fields to User Contact Fields in WordPress\" width=\"604\" height=\"355\" border=\"0\" \/><\/p>\n<p>The first thing you need to do is load up the editor by going to Admin &gt;&gt;&gt; Appearance&gt;&gt;&gt;Editor&gt;&gt;&gt;Functions.php. Once the Functions.php is loaded, make sure to back up the file before making any changes.<\/p>\n<p>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 ?&gt; 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+.<br \/>\n[php]<br \/>\nfunction extra_contact_info($contactmethods) {<br \/>\n    unset($contactmethods[&#8216;aim&#8217;]);<br \/>\n    unset($contactmethods[&#8216;yim&#8217;]);<br \/>\n    $contactmethods[&#8216;twitter&#8217;] = &#8216;Twitter&#8217;;<br \/>\n    $contactmethods[&#8216;facebook&#8217;] = &#8216;Facebook&#8217;;<br \/>\n    $contactmethods[&#8216;linkedin&#8217;] = &#8216;LinkedIn&#8217;;<br \/>\n    $contactmethods[&#8216;gprofile&#8217;] = &#8216;Google Plus Profile&#8217;;<br \/>\n    return $contactmethods;<br \/>\n}<br \/>\nadd_filter(&#8216;user_contactmethods&#8217;, &#8216;extra_contact_info&#8217;);<br \/>\n[\/php]<br \/>\nIf you want to keep the default fields, then add this code instead.<br \/>\n  [php]<br \/>\nfunction extra_contact_info($contactmethods) {<br \/>\n    $contactmethods[&#8216;twitter&#8217;] = &#8216;Twitter&#8217;;<br \/>\n    $contactmethods[&#8216;facebook&#8217;] = &#8216;Facebook&#8217;;<br \/>\n    $contactmethods[&#8216;linkedin&#8217;] = &#8216;LinkedIn&#8217;;<br \/>\n    $contactmethods[&#8216;gprofile&#8217;] = &#8216;Google Plus Profile&#8217;;<br \/>\n    return $contactmethods;<br \/>\n}<br \/>\nadd_filter(&#8216;user_contactmethods&#8217;, &#8216;extra_contact_info&#8217;);<br \/>\n  [\/php]<\/p>\n<p><em>Original Source of code came from and article from <\/em><a href=\"http:\/\/www.webfroze.com\/wordpress\/add-contact-fields-to-user-profile\/\" target=\"_blank\"><em>Web Froze<\/em><\/a><em>. The code is basically the same, I just changed the order of how the contact fields display. <\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019t even have it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[1032,394,487],"class_list":["post-4124","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-addremove-fields-from-user-contact-info-field","tag-wordpress-tips","tag-wordpress-tutorials","entry","has-post-thumbnail"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pJPdG-14w","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/posts\/4124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/comments?post=4124"}],"version-history":[{"count":0,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/posts\/4124\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/media?parent=4124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/categories?post=4124"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.evolutionarydesigns.net\/blog\/wp-json\/wp\/v2\/tags?post=4124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}