How To Display Custom Message To WordPress Login Page

Sometime as Site Admin we wanted our users to be notified about something important while they are about to Log In into WordPress back-end. for example, we might give them instruction to change passwords for security reason or want them to know you are super genius
WordPress allows us to display custom message to WordPress Log in Page using its filter login_message , see example below..
WordPress-Demo-Log-Inall we need to do is to open up our active theme’s function.php file into our favorite code editor (I am using beautiful code editor Brackets, you can use whatever your favorite code editor is.) ¬†and insert following code into it. you can change welcome message as per your requirements within this code.


function bdn_login_text( $customtext ) {
 if ( empty($customtext) ){
 return "<p class='message'>Welcome to WordPress Demo site. This is Custom Text Message for Visitors.</p>";
 } else {
 return $customtext;
 }
}
add_filter( 'login_message', 'bdn_login_text' );

Save file, and open your WordPress Log in Page to see your Custom Message.

Leave a Reply