Software Developer

Remove Personal Options in WordPress Admin Profile Page

This function removes fields on the Profile page (user Profile) of the WordPress dashboard. It shows you how to remove fields in the Personal Options section, Name section, Contact Info section, and About Yourself section.

Here is a list of which field of the user Profile each line removes. If you don’t want to remove one of those fields, then you can erase that corresponding line in the code, or just comment it out by adding two slashes at the beginning of that line in the code, like this: //.

This code will add some JavaScript to the head of your WordPress admin, not on the front of your site. This code uses jQuery. To use this code, you would add it to your functions.

Last tested on WordPress version 4.9-alpha-41690.

What each line in the code removes:

Line 4 will remove the “Personal Options” title.

Line 6 will remove the “Visual Editor” field in the “Personal Options” section.

Line 8 will remove the “Admin Color Scheme” field in the “Personal Options” section.

Line 10 will remove the “Keyboard Shortcuts” field in the “Personal Options” section.

Line 12 will remove the “Toolbar” field in the “Personal Options” section.

Line 14 will remove the “Language” field in the “Personal Options” section.

Line 16 will remove the “First Name” field in the Name section.

Line 18 will remove the “Last Name” field.

Line 20 will hide the “Nickname” field. (This is hidden rather than removed because the nickname is a required field.

Line 22 will remove the “Display name publicly as” field.

Line 24 will remove the “Website” field in the “Contact Info” section.

Line 26 will remove the “About Yourself” title (when viewing your own profile), and the “About the user” title (when viewing someone else’s profile).

Line 28 will remove the “Biographical Info” field in the “About Yourself” section.

Line 30 will remove the “Profile Picture” field in the “About Yourself” section.

Line 32 will remove the “AIM” field in the “Contact Info” section.

Line 34 will remove the “Yahoo IM” field in the “Contact Info” section.

Line 36 will remove the “Jabber / Google Talk” field in the “Contact Info” section.

Line 38 will remove the “Name” heading.

Line 40 will remove the “Contact Info” heading.

function remove_personal_options(){
    echo '<script type="text/javascript">jQuery(document).ready(function($) {
 
$(\'form#your-profile > h2:first\').remove(); // remove the "Personal Options" title
 
$(\'form#your-profile tr.user-rich-editing-wrap\').remove(); // remove the "Visual Editor" field
 
$(\'form#your-profile tr.user-admin-color-wrap\').remove(); // remove the "Admin Color Scheme" field
 
$(\'form#your-profile tr.user-comment-shortcuts-wrap\').remove(); // remove the "Keyboard Shortcuts" field
 
$(\'form#your-profile tr.user-admin-bar-front-wrap\').remove(); // remove the "Toolbar" field
 
$(\'form#your-profile tr.user-language-wrap\').remove(); // remove the "Language" field
 
$(\'form#your-profile tr.user-first-name-wrap\').remove(); // remove the "First Name" field
 
$(\'form#your-profile tr.user-last-name-wrap\').remove(); // remove the "Last Name" field
 
$(\'form#your-profile tr.user-nickname-wrap\').hide(); // Hide the "nickname" field
 
$(\'table.form-table tr.user-display-name-wrap\').remove(); // remove the “Display name publicly as” field
 
$(\'table.form-table tr.user-url-wrap\').remove();// remove the "Website" field in the "Contact Info" section
 
$(\'h2:contains("About Yourself"), h2:contains("About the user")\').remove(); // remove the "About Yourself" and "About the user" titles
 
$(\'form#your-profile tr.user-description-wrap\').remove(); // remove the "Biographical Info" field
 
$(\'form#your-profile tr.user-profile-picture\').remove(); // remove the "Profile Picture" field
 
$(\'table.form-table tr.user-aim-wrap\').remove();// remove the "AIM" field in the "Contact Info" section

$(\'table.form-table tr.user-yim-wrap\').remove();// remove the "Yahoo IM" field in the "Contact Info" section

$(\'table.form-table tr.user-jabber-wrap\').remove();// remove the "Jabber / Google Talk" field in the "Contact Info" section

$(\'h2:contains("Name")\').remove(); // remove the "Name" heading

$(\'h2:contains("Contact Info")\').remove(); // remove the "Contact Info" heading

});</script>';
 
}
 
add_action('admin_head','remove_personal_options');

See more: ,

By

We've 29 Responses

    • April 12th, 2013 at 10:42 pm

      Your welcome. Try this

      function change_about_us(){echo "\n"
       . '<script type="text/javascript">jQuery(document).ready(function($) {
      $(\'form#your-profile > h3:eq(3)\').replaceWith(\'<h3>Your Custom Text Here</h3>\');
      }); </script>' . "\n"; }
      add_action('admin_head','change_about_us');
      

      or, if you’re using the main function on this page, just add this single line into it. Insert it right after line 7.

      $(\'form#your-profile > h3:eq(3)\').replaceWith(\'<h3>Your Custom Text Here</h3>\');
      

      In either case, replace “Your Custom Text Here” with your own text. Hope this helps.

      avatar
    • October 27th, 2014 at 12:14 pm

      To hide it only for non-admin users, use this instead:

      function hide_personal_options(){
      	if ( ! current_user_can('manage_options') ) {
      		echo "\n"
       . '<script type="text/javascript">jQuery(document).ready(function($) {
      $(\'form#your-profile > h3:first\').hide();
      $(\'form#your-profile > table:first\').hide();
      $(\'table.form-table:eq(1) tr:eq(3)\').hide();
      $(\'table.form-table:eq(1) tr:eq(4)\').hide();
      $(\'table.form-table:eq(2) tr:eq(1)\').hide();
      $(\'form#your-profile\').show(); }); </script>' . "\n";
      	}
      }
      add_action('admin_head','hide_personal_options');
      
      avatar
  1. October 27th, 2014 at 12:50 pm

    If I may?:P

    $(\’table.form-table:eq(2) tr:eq(1)\’).hide();

    i noticed (.hide ) –
    Can i use something instead to disable this field form editing, but to leave visible perhaps?

    avatar
    • October 28th, 2014 at 10:27 am

      This will do it. Line 1 makes the input field “Read Only”, so it cannot be changed. Line 2 makes it gray.

      jQuery(\'table.form-table:eq(2) tr:eq(1)\').keydown(function(){return false;});
      $(\'table.form-table:eq(2) tr:eq(1) input\').css(\'color\',\'gray\');
      

      I’m assuming that you added a default value for the Website field with this:

      $(\'table.form-table:eq(2) tr:eq(1) input\').attr(\'value\', \'YOUR WEBSITE VALUE\');
      

      Hope that helps.

      avatar
  2. October 28th, 2014 at 11:03 am

    Hi Isabel,

    Yes very helpful 😛
    Couldn’t do it without you!

    This is the code im using now

    function hide_personal_options(){
    if ( ! current_user_can('manage_options') ) {
    echo &quot;\n&quot;
     . '&lt;script type=&quot;text/javascript&quot;&gt;jQuery(document).ready(function($) {
    
    jQuery(\'table.form-table:eq(2) tr:eq(1)\').keydown(function(){return false;});
    $(\'table.form-table:eq(2) tr:eq(1) input\').css(\'color\',\'gray\');
    $(\'table.form-table:eq(2) tr:eq(1) input\').attr(\'value\', \'WG OPEN ID#\');
    $(\'form#your-profile\').show(); }); &lt;/script&gt;' . &quot;\n&quot;;}
    }
    add_action('admin_head','hide_personal_options');
    
    avatar
  3. April 28th, 2017 at 3:42 am

    Hi Isabel,

    Great post!

    F.Y.I. The required “nickname” field cannot be removed because on update, if you don’t send that (or any other essential field) to the WP update hook, then it sets empty values to those fields and produces an error.

    Also, any idea how I can remove the entire “Proofreading” section?
    What about the “About Yourself” / “About the user” titles.

    Thanks

    avatar
    • May 7th, 2017 at 4:40 pm

      Thank you. I just updated this to hide, rather than remove, the nickname field in order to avoid the error. I also fixed the code to properly remove the “About Yourself” and “About the user” titles. Thanks for catching that.

      “Proofreading” section? I don’t see that. Is that section added by a plugin?

      avatar
  4. June 15th, 2017 at 12:07 am

    When I copy and paste this code into my functions.php file in the child theme it is not working for some reason it is getting errors. I think because the javascript isn’t commented out properly???

    avatar
    • June 22nd, 2017 at 2:15 pm

      By default, WordPress doesn’t have a Google+ field, but it does have a “Jabber/Google Talk” field. You can remove the “” field by inserting this into line 31:

      $(\'form#your-profile tr.user-jabber-wrap\').remove(); // remove the "Jabber/Google Talk" field

      If you have a theme or plugin that is adding a custom Google+ field, you’ll need to find out the CSS class selector that is given to that item in order to remove it.

      avatar
  5. July 15th, 2017 at 6:47 pm

    Hi Isabel.

    Thank you so much for your tutorial. I am wondering- do you know how to remove Facebook / AIM / Jabber / Yahoo IM / Google + / Twitter as well?

    Thanks so much!

    Also I want to do this for only non- admin users. I tried putting in

    …[code moderated]...

    But it came back as an error.

    avatar
    • October 3rd, 2017 at 12:39 pm

      You’re welcome. I just added the lines for removing AIM, Yahoo IM, and Jabber/Google Talk. However, Facebook, Google+, and Twitter are not added by WordPress so I’m not sure how to remove it without seeing which plugin adds that.

      From what I could see of your code, the function name was wrong. Try copying the code from above. To apply it only for non-admin users, insert this into the beginning of line 2 (push the current line 2 down to create a new blank line):

      	if ( current_user_can('manage_options') ) {
      		return false;
      	}
      
      avatar
  6. July 24th, 2017 at 9:53 am

    Hi, thanks for your hook. I’m looking for the way to change on add user page and profile page the label “website” with label “Country” by adding code on function.php.

    Any idea?

    Thanks again 🙂

    avatar
    • October 3rd, 2017 at 12:50 pm

      This will work:

      function my_change_personal_options_website_label(){
          echo '<script type="text/javascript">jQuery(document).ready(function($) {
        
      $(\'table.form-table tr.user-url-wrap label\').text( "Country" );// change the "Website" label to "Country" in the "Contact Info" section
        
      
      $(\'#createuser .form-table label[for="url"]\').text( "Country" );// change the "Website" label to "Country" on the Add New User page
      
      });</script>';
        
      }
        
      add_action('admin_head','my_change_personal_options_website_label');
      
      avatar
  7. January 22nd, 2018 at 1:34 am

    Wow, this is amazingly helpful! Thank YOU SO much!!!

    I was searching and trying to figure all this out, and I came across your tutorial.

    I would like to ask, I am trying to learn how to develop for WordPress. I often reference the codex, but stuff like this is not as easy to find. What might you suggest that I learn in order to become more proficient in figuring out solutions like the one you posted above?

    Thanks in advance for this blog and for your help!

    avatar
  8. March 5th, 2018 at 7:01 am

    Hi Isabel,

    Thank you for the code snippet! Would you be so kind to add some lines to hide the labels (headings 2): Name & Contact Info ?

    With kind regards,

    Sjors

    avatar

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]