Title: user_profile_update_errors
Published: April 25, 2014
Last modified: April 28, 2025

---

# do_action_ref_array( ‘user_profile_update_errors’, WP_Error $errors, bool $update, stdClass $user )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#wp--skip-link--target)

Fires before user profile update errors are returned.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#parameters)󠁿

 `$errors`[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)

[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/) object (
passed by reference).

`$update`bool

Whether this is a user update.

`$user`stdClass

User object (passed by reference).

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#more-information)󠁿

This hook runs AFTER [edit_user_profile_update](https://developer.wordpress.org/reference/hooks/edit_user_profile_update/)
and [personal_options_update](https://developer.wordpress.org/reference/hooks/personal_options_update/).
If you want to validate some custom fields before saving, a workaround is to check
the $errors array in this same callback, after performing your validations, and 
save the data if it is empty.

On return, if the errors object contains errors then the save is not completed &
the errors displayed to the user.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#source)󠁿

    ```php
    do_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/user.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/user.php#L226)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/user.php#L226-L226)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#related)󠁿

| Used by | Description | 
| [edit_user()](https://developer.wordpress.org/reference/functions/edit_user/)`wp-admin/includes/user.php` |

Edit user settings based on contents of $_POST

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/?output_format=md#comment-content-4439)
 2.   [Collins Mbaka](https://profiles.wordpress.org/collinsmbaka/)  [  5 years ago  ](https://developer.wordpress.org/reference/hooks/user_profile_update_errors/#comment-4439)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fuser_profile_update_errors%2F%23comment-4439)
    Vote results for this note: 4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fuser_profile_update_errors%2F%23comment-4439)
 4.     ```php
        function check_fields($errors, $update, $user) {
        	$errors->add('demo_error',__('This is a demo error, and will halt profile save'));
        }
        add_action('user_profile_update_errors', 'check_fields', 10, 3);
        ```
    
 5.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fuser_profile_update_errors%2F%3Freplytocom%3D4439%23feedback-editor-4439)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fuser_profile_update_errors%2F)
before being able to contribute a note or feedback.