DEV Community

Cover image for Change logo on login page in WordPress
Chris Texe
Chris Texe

Posted on • Edited on

4 1

Change logo on login page in WordPress

Do you want to change logo on WordPress login page? Open functions.php file and add this code:

// Change logo on login page
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url(https://your-domain.com/wp-content/uploads/custom-logo.png) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
view raw functions.php hosted with ❤ by GitHub

From now your logo will appear on WordPress' login page. It's small but very nice change. But the url still redirects to https://wordpress.com. I hear the question in your head: how to change this url to my website? Very easy:

// Change logo url on WordPress login page
add_filter( 'login_headerurl', 'custom_loginlogo_url' );
function custom_loginlogo_url($url) {
return 'https://madlon.eu';
}
view raw functions.php hosted with ❤ by GitHub

Of course change the link https://madlon.eu to your website.


It would be great if you will comment or follow me on social media:

Chris Texe Twitter

Chris Texe LinkedIn

Also you can visit my websites:

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay