Home » Tutorial » Custom After Registration Message in WordPress

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.

Read more from Tutorial

Written by:

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

Have you written on ThoughtMight?Write Today



Leave a Comment

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