WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I trigger a message box to appear on the login form?

I'l trying to get the little yellow notice bar to appear above the login form conditionally.

The below code only print the content on the page (duh, I know).

add_action('login_head', 'login_form_message');
function login_form_message() {
    echo 'Custom Login Form Message';
share|improve this question
up vote 3 down vote accepted

There's a filter to add messages there. You can sneak in messages that will than handled like an error message (without being one).

apply_filters( 'login_message', $message );

Here's an example of this filter:

function wpse79920_login_msg( $message )
    return 'Hello User!';
add_filter( 'login_message', 'wpse79920_login_msg' );
share|improve this answer
Thank you! That lead me to this: jarrodpyper.com/blog/… – mattrepublic Jan 9 '13 at 21:20
@mattrepublic Wat? Don't get your point - didn't you want to add a message? – kaiser Jan 9 '13 at 21:34
Yes, adding the <p class="message"> put Hello user! in the box. I wouldn't have found that without the filter name you gave me. I'll be sure to dig deeper into filter next time. – mattrepublic Jan 9 '13 at 23:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.