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');
shae
April 12th, 2013 at 10:14 am
Thanks for the code. How would you replace the text “About Yourself” with something differnet?
Isabel
April 12th, 2013 at 10:42 pm
Your welcome. Try this
or, if you’re using the main function on this page, just add this single line into it. Insert it right after line 7.
In either case, replace “Your Custom Text Here” with your own text. Hope this helps.
shae
April 14th, 2013 at 10:04 am
Thank You!!
Akki
October 27th, 2014 at 3:07 am
Hi
Can you remove specified filed – above – i my case i need website removed – for only non-admin users?
thanks
Isabel
October 27th, 2014 at 12:14 pm
To hide it only for non-admin users, use this instead:
Akki
October 27th, 2014 at 12:32 pm
Thanks Ms Isabel , I Appreciate your help.
I used code before one you just posted , figured out how to add things i need to hide:P
Akki
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?
Akki
October 27th, 2014 at 1:12 pm
OK got it, kind of i guess
$(\’table.form-table:eq(2) tr:eq(1)\’).prop( “disabled”, true )();
But its not grayed out…
Isabel
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.
I’m assuming that you added a default value for the Website field with this:
Hope that helps.
Akki
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
Fernando Lopes
February 22nd, 2017 at 11:59 am
Perfect your code Works perfectly.
How could I be hiding “About Yourself, Biographical Info and Profile Picture”?
Thank you.
Isabel
February 25th, 2017 at 5:42 pm
Thank you. I just updated this to hide those sections.
Jacob
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
Isabel
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?
Han
May 2nd, 2017 at 10:58 am
Thanks a lot Isabel. Works like a charm
Paul
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???
Isabel
June 17th, 2017 at 6:12 pm
Did you modify the code? What part did you comment out? If you paste the exact code you used, I can check it out.
Marijn
June 22nd, 2017 at 9:01 am
Thanks so much for this code!
How would you remove the google+ field from contact info?
Isabel
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:
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.
0101 Design
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.
Isabel
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):
Momses
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 🙂
Isabel
October 3rd, 2017 at 12:50 pm
This will work:
Rafael Rodrigues
October 2nd, 2017 at 10:54 am
Thank you lady! This is just what I was looking for and it worked without any need of plugins. Awesome!
Peninah
November 20th, 2017 at 4:08 am
Thank you!! This worked beautifully.
JRod
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!
Sjors
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
Isabel
January 30th, 2020 at 3:55 pm
I added lines to remove the “Name” heading and “Contact Info” heading.
Quang
August 10th, 2018 at 12:46 am
Thank you 🙂
Alan
May 26th, 2020 at 11:50 pm
Nice code snippet, thanks. I found I had to also add this line:
I guess it’s a WP5 thing, but everything else working nicely.