Halloween Sale 15% off Ends in See the plans
PHP

Friendlier Messages on the Registration Screens

Explains what happens next above the WordPress registration form and replaces the terse "Registration complete" notice with clearer instructions about the confirmation email.

Don’t have WPIDE yet? Install it on your site

Code

$wpide_register_intro = 'Create your free account. We will email you a link to set your password, so use an address you can access right now.';
$wpide_register_done  = 'Almost there! Check your inbox for an email with a link to set your password. It can take a few minutes; look in your spam folder too.';

add_filter( 'login_message', function ( $message ) use ( $wpide_register_intro ) {
    $action = isset( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : '';

    return 'register' === $action ? '<p class="message register">' . esc_html( $wpide_register_intro ) . '</p>' : $message;
} );

add_filter( 'wp_login_errors', function ( $errors ) use ( $wpide_register_done ) {
    if ( $errors instanceof WP_Error && isset( $_GET['checkemail'] ) && 'registered' === $_GET['checkemail'] && $errors->get_error_code() ) {
        $errors->remove( 'registered' );
        $errors->add( 'registered', esc_html( $wpide_register_done ), 'message' );
    }

    return $errors;
} );

Notes

Edit both texts at the top; they appear on wp-login.php?action=register and right after registering.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.