WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

is there a way to add custom user meta fields (like the one in the profile.php which contain specific user data), but only an admin (or an other user with enough capabilities) can change them? Maybe I'm thinking too complicated, how would you tell your site visitors who from your users is doing which work on the site, if there are too many users (and probably often changing work) that it would be impossible too make a static page or something.

Greetings, .wired

// edit: you may replace "work" with position. I want to give the users a specific position. That's not the user role!

share|improve this question
up vote 2 down vote accepted

I think I get what you are saying, and if not, forgive me:

just add your meta fields / metabox inside:

if( current_user_can( 'administrator' ) ){  // put code here }

*this is assuming you aren't asking how to add a metafield or metabox.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.