Title: register_post
Published: April 25, 2014
Last modified: February 24, 2026

---

# do_action( ‘register_post’, string $sanitized_user_login, string $user_email, WP_Error $errors )

## In this article

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

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

Fires when submitting registration form data, before the user is created.

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

 `$sanitized_user_login`string

The submitted username after being sanitized.

`$user_email`string

The submitted email.

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

Contains any errors with submitted username and email, e.g., an empty field, an 
invalid username or email, or an existing username or email.

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

This [action hook](https://codex.wordpress.org/Plugin_API/Action_Reference) can 
be used to handle post data from a user registration **before** the [registration_errors](https://developer.wordpress.org/reference/hooks/registration_errors/)
filter is called or errors are returned.

Please note that this hook should **never** be used for custom validation. Any custom
validation rules should be performed using the [registration_errors](https://developer.wordpress.org/reference/hooks/registration_errors/)
filter.

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

    ```php
    do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
    ```

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

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

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

Handles registering a new user.

  |

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

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

## User Contributed Notes

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