Removing Profile Fields

In order to remove fields from a form, you will utilize the tml_remove_form_field() function. This function accepts two arguments: the name of the form, and the name of the field. Let's say we want to remove the "First Name" and "Last Name" fields. Consider the following code:

function remove_tml_profile_fields() {
	tml_remove_form_field( 'profile', 'first_name' );
	tml_remove_form_field( 'profile', 'last_name' );
}
add_action( 'init', 'remove_tml_profile_fields' );

The following fields are part of the Profile form:

  • personal_options_section_header
  • admin_bar_front
  • locale
  • name_section_header
  • user_login
  • first_name
  • last_name
  • nickname
  • display_name
  • contact_info_section_header
  • email
  • url
  • aim (As a result of wp_get_user_contact_methods())
  • yim (As a result of wp_get_user_contact_methods())
  • jabber (As a result of wp_get_user_contact_methods())
  • about_yourself_section_header
  • description
  • avatar
  • account_management_section_header
  • pass1
  • pass2
  • show_user_profile (This is the action hook)
  • submit