Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/user profile update errors


  • &$errors - Errors object to add any custom errors to
  • $update - true if updating an existing user, false if saving a new user
  • &$user - User object for user being edited

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

Example usage

function check_fields($errors, $update, $user) {
	$errors->add('demo_error',__('This is a demo error, and will halt profile save'));
add_filter('user_profile_update_errors', 'check_fields', 10, 3);


This hook runs AFTER edit_user_profile_update and 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.


This hook can be found in wp-admin/includes/user.php

This page is marked as incomplete. You can help Codex by expanding it.

Return to Plugin API/Filter Reference