Isabel Castillo

Web & Software Developer • I ♥ PHP

Remove Aim, Yahoo IM, Jabber Contact Info From WordPress Profile

This is the Code Graveyard where I lay to rest snippets of code that I don't use anymore. Some have lost their usefulness due to evolving standards, while others were bad from the start.

This function removes these fields from the Contact Info section of the WordPress user profile admin page:
AIM
Yahoo IM
Jabber/Google Talk

code snippet

WordPress

// Remove Silly Contact Methods

function removesilly_contactmethods( $contactmethods ) {
// here you could add other fields
  unset($contactmethods['yim']); // Remove Yahoo IM
  unset($contactmethods['aim']); // Remove AIM
  unset($contactmethods['jabber']); // Remove Jabber

return $contactmethods;
}

add_filter('user_contactmethods','removesilly_contactmethods',10,1);

If you want to add fields for users to enter their Facebook profile URL, and their Twitter, and Google Plus, take the following code, and insert it into line 4 in the code above.

code snippet

WordPress

$contactmethods['facebook'] = 'Facebook'; // Add Facebook
$contactmethods['twitter'] = 'Twitter'; // Add Twitter
$contactmethods['gplus'] = 'Google+'; // Add Google Plus

By

I'm a web and software developer. When I'm not complaining that "this was all fields," I can be found on my machine optimizing some sweet code. I hope I'm not violating a WordPress copyright when I say that code is poetry. See my code journal for useful snippets.

One Response

  1. Really like this, and glad I’ve found it! Definitely going to use it on my WordPress installs.

    yoldaolmak.com

    December 15th, 2012 at 3:34 am

Questions and Comments are Welcome

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