WordPress at Your Fingertips
filter is not described

wp_pre_insert_user_data filter-hook . WP 4.9.0

Filters user data before the record is created or updated.

It only includes data in the users table, not any user metadata.


add_filter( 'wp_pre_insert_user_data', 'filter_function_name_1883', 10, 4 );
function filter_function_name_1883( $data, $update, $id, $userdata ){
	// filter...

	return $data;

Values and keys for the user.

  • user_login(string)
    The user's login. Only included if $update == false

  • user_pass(string)
    The user's password.

  • user_email(string)
    The user's email.

  • user_url(string)
    The user's url.

  • user_nicename(string)
    The user's nice name. Defaults to a URL-safe version of user's login

  • display_name(string)
    The user's display name.

  • user_registered(string)
    MySQL timestamp describing the moment when the user registered.
    Default: current UTC timestamp
Whether the user is being updated rather than created.
ID of the user to be updated, or NULL if the user is being created.
The raw array of data passed to wp_insert_user().


Since 4.9.0 Introduced.
Since 5.8.0 The $userdata parameter was added.

Where the hook is called

wp-includes/user.php 2037
$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? (int) $ID : null ), $userdata );

Where in WP core the hook is used WordPress

Usage not found.