# 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.

- Type: PHP
- Runs: Run everywhere
- Category: [Login](https://wpide.com/library/category/login/)
- Tags: login, message, notice
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/login-message-above-form/

## Code

```php
// 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 use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Message Above the Login Form" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
