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

I have removed the edit profile page from WP admin as I don't want users to be able to edit their details as this is a closed intranet and their details are fed from AD.

However I do want them to be able to publish their own user description (Biography). So I've set out to add a new admin page to give the user the ability to do that:

add_action('admin_menu', 'sc_stace_user_bio_page');
function sc_stace_user_bio_page() {
    $page = add_menu_page( "Your Biography", "Biography", "read", "user-bio", "sc_stace_user_bio_page_content", "", 50 );

function sc_stace_user_bio_page_content() {
    global $current_user;
    <div class="wrap">
        <h2>Your Biography</h2>
        <form action="options.php" method="post">
            <textarea rows="10" cols="100" name="user_description"><?php echo esc_textarea($current_user->user_description); ?></textarea>
            <?php submit_button( "Save", "primary", "submit", true ); ?>

As far as I know I cannot use the Settings API here as this info needs saving into the logged in users meta not into options table. So now I'm stuck as I don't know where the form should be saving to and how to check for form submission the correct way.

So where should I be submitted the form to? What nonces if any should I be putting in the form? What do I need to hook into for checking form submission and if correct data is being sent save to user's meta?

share|improve this question
up vote 2 down vote accepted
update_user_meta($current_user->ID, 'description', $_POST['user_description']);

in the form processing function will save the bio.

I would keep the form action on the same admin page. As for data validation, I don't see what there is to validate in the first place. It's just a string - not an email, address or the like that needs to be checked against a certain format.

share|improve this answer

As in Johannes answer update_user_meta is pretty much all you need as far as data validation. Justin Tadlock has a great blog post on adding custom user meta fields. Just add the function that outputs the form on your new admin page.

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.