do_action( 'profile_update', int $user_id, WP_User $old_user_data, array $userdata )

Fires immediately after an existing user is updated.



(int) User ID.


(WP_User) Object containing user's data prior to update.


(array) The raw array of data passed to wp_insert_user().

Top ↑


File: wp-includes/user.php

View on Trac

Top ↑


Version Description
5.8.0 The $userdata parameter was added.
2.0.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 2 content
    Contributed by Uriahs Victor

    Finding out if a user email was updated from the admin dashboard, can work for other fields as well if value being checked is changed:

    function wpdocs_check_user_email_updated( $user_id, $old_user_data ) {
    	$old_user_email = $old_user_data->data->user_email;
    	$user = get_userdata( $user_id );
    	$new_user_email = $user->user_email;
    	if ( $new_user_email !== $old_user_email ) {
    		// Do something if old and new email aren't the same
    add_action( 'profile_update', 'wpdocs_check_user_email_updated', 10, 2 );

You must log in before being able to contribute a note or feedback.