Custom After Registration Message in WordPress

Custom After Registration Message in WordPress

In this tutorial, I will show you how to change or customize “Registration complete. Please check your email, then visit the login page” message.

By default, a successful registration in WordPress shows this message. But you can change that. You can request users to check the spam folder too for your email.

To do so, paste following code in your theme’s functions.php file.

add_filter( 'wp_login_errors', 'filter_wp_login_errors', 10, 2 );
function filter_wp_login_errors( $errors, $redirect_to ) {
	if( strpos($_SERVER['REQUEST_URI'],'checkemail=registered') !== false ) {
		$errors->remove( 'registered');
		$errors->add( 'registered', sprintf( __( 'Please check your Spam box if email is not to be found in inbox.' ), wp_login_url( ) ), 'message' );
		return $errors;
	}
	else{ return $errors; }
}

Change the error message according to your need.

Spread the love

A teacher by profession, a traveler by passion and a netizen by choice.

Morshed Alam

You use WordPress! Why don't we share our experiences. It may be a tutorial, tips, tricks, tweaks or about security, performance or WordPress news. Write Today

Leave a Comment

Your email address will not be published. Required fields are marked *