How To: Remove Default Profile Fields in WordPress

A few days ago I came across an interesting challenge in WordPress. I wanted to hide some of the default profile fields from being displayed to the users in WordPress. Specifically I wanted to hide the AIM, Yahoo IM, and Jabber / Google Talk fields. It took a bit of digging but I found the below function buried in the WordPress.org support forums. Just place the below code in your themes functions.php file to remove these fields:

<?php
add_filter('user_contactmethods','hide_profile_fields',10,1);

function hide_profile_fields( $contactmethods ) {
  unset($contactmethods['aim']);
  unset($contactmethods['jabber']);
  unset($contactmethods['yim']);
  return $contactmethods;
}
?>

That’s it! As you can see below the three fields are removed from the Profile page on the WordPress admin side. This makes it much less confusing for users since they don’t see fields that we aren’t using on the website.