Title: Update Description via PHP
Last modified: December 6, 2018

---

# Update Description via PHP

 *  Resolved [aehernandez](https://wordpress.org/support/users/aehernandez/)
 * (@aehernandez)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/update-description-via-php/)
 * Hi!
 * I want to update the description of the user profile via PHP and send it to the
   database on user registration. Is there a way I can work around this?
 * I’ve tried the following:
 *     ```
       add_action( 'user_register', 'expertopyme_update', 10, 1 );
   
       function expertopyme_update( $user_id ) {
           $user = get_userdata( $user_id );
           $interes =  $user->ep_interes;
       	update_user_meta( $user_id, 'description', $interes );
       }
       ```
   
 * (I’m sorry, I’m really new to developing for wordpress)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Priyanka Behera](https://wordpress.org/support/users/priyankabehera155/)
 * (@priyankabehera155)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/update-description-via-php/#post-10953058)
 * Hi [@aehernandez](https://wordpress.org/support/users/aehernandez/)
 * You can use the below function to update the descriptions.
 * wp_update_user( array( ‘ID’ => $user_id, ‘user_url’ => $website ) );
 *  Thread Starter [aehernandez](https://wordpress.org/support/users/aehernandez/)
 * (@aehernandez)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/update-description-via-php/#post-10953735)
 * Thank you for your help, [@priyankabehera155](https://wordpress.org/support/users/priyankabehera155/)!
 * Is there an specific action where it should be included to update the description
   on registration?
    -  This reply was modified 7 years, 6 months ago by [aehernandez](https://wordpress.org/support/users/aehernandez/).
 *  Thread Starter [aehernandez](https://wordpress.org/support/users/aehernandez/)
 * (@aehernandez)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/update-description-via-php/#post-10954318)
 * Nevermind, [@priyankabehera155](https://wordpress.org/support/users/priyankabehera155/).
   Thank you for your help!
 * Managed to do it like this:
 *     ```
       add_action( 'user_register', 'my_save_extra_fields', 10, 1 );
   
       function my_save_extra_fields( $user_id ) {
          $user = get_userdata( $user_id );
          $interes =  $user->ep_interes;
          $user_data = wp_update_user( array( 'ID' => $user_id, 'description' => $interes ) );
           if ( isset( $_POST['description'] ) )
               update_user_meta($user_id, 'description', $_POST['description']);
   
       }
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Update Description via PHP’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [aehernandez](https://wordpress.org/support/users/aehernandez/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/update-description-via-php/#post-10954318)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
