In today’s tutorial, we’ll learn how to customize our WordPress login page by adding custom message on WordPress login page. This is an example of our default login page:
The default login page looks very plain. Let’s add some useful text to our login page. To add or edit a custom message to our login page, we can use login_message
filter. The filter can return an HTML output. Here’s an example of the complete snippet that can be copied:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Here’s the result of what you’ll see on your login page:
I suggest you to put the code inside your site functionality plugin, not on your theme’s functions.php file since this is not a theme-specific feature. By placing the code in your functionality plugin, the custom message won’t be removed when you change your theme in future. In future, we hope to cover more tutorial on customizing your login page. Previously, we’ve also published a tutorial on adding a popup registration form to your WordPress site. For more WordPress tutorials, feel free to subscribe to our RSS feed. You won’t be disappointed.
Dave says
Would you mind sharing the purpose for this part:
`if ( empty($message) ){`
Does that mean it will only show this message if none of the default WordPress messages (logged out, password reset sent, etc.) are being displayed?
Also, to stay consistent with styling, you can add a class to the p tag: “. That produces a design like this screenshot.
Dave says
Sorry, that last comment got some HTML stripped out.
Change the p tag to look like this:
<p class="message">
Brad Scott says
Thanks for sharing this tips. I will definitely use this tips for my blog.
Bennie says
Howdy this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!
Editor says
If you’re asking about WordPress, then the answer is yes. Feel free to contact us if you’d like ask anything about WordPress.