How to Change Registration Email of WordPress

Learn how to change the default email that WordPress sends out for registration without editing WordPress Core Files.

Learn how to change the registration email from WordPress with a simple hook through your functions.php file.

add_filter('wp_new_user_notification_email', 'rego_welcome_email', 10, 3);

function rego_welcome_email($wp_new_user_notification_email, $user, $blogname){
        //change the default email
        $key = get_password_reset_key( $user );

        $message  = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
        $message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n";
        $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "\r\n\r\n";

        $message .= "\r\n";

        $wp_new_user_notification_email['message'] = $message;

        return $wp_new_user_notification_email;