Message Above the Login Form
Shows your own notice above the login form, for example to point customers to the shop account page or announce maintenance.
Opens WPIDE on
Code
// HTML is allowed (links, bold text).
$wpide_login_notice = 'This login is for staff. Customers can <a href="/my-account/">sign in to their account here</a>.';
add_filter( 'login_message', function ( $message ) use ( $wpide_login_notice ) {
$action = isset( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : 'login';
if ( 'login' !== $action || '' === $wpide_login_notice ) {
return $message;
}
return $message . '<p class="message">' . wp_kses_post( $wpide_login_notice ) . '</p>';
} );
Notes
The message only shows on the main login screen, not on password reset or registration.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.