Disable WordPress Profile Fields

If you have been using WordPress for any amount of time, you may have found user profile management to be a bit lacking in terms of configuration. Most installations I have come across have either a membership plugin or a plugin that extends the user profile to collect more information. Regardless, from time to time it would be nice to make certain user profile fields only editable by the site administrator. In the article below we will detail the steps to disable the First Name, Last Name and Display Name fields for all users except administrators. It is important to note that there are two functions used to accomplish this task. First, we will need to create the calgary_profile_fields_disable_js() function that will set the input field properties using jQuery. Next, we will need to create the calgary_profile_fields_disable() function that will determine if the user is an “administrator” and if not will disable the appropriate profile fields using our previous function calgary_profile_fields_disable_js(). In order to bring it all together, simply edit and/or copy the code below into the functions.php file of your WordPress theme.

Did you find this article useful? Why not share it with your friends?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.