How to change the WordPress Login image and URL

- by

Screen Shot 2013-09-06 at 15.54.53There’s a great little plugin called Add Logo to Admin by c.bavota which does a great job at letting you add your own logo to the WordPress login screen, and even to the top of your dashboard. But it’s another plugin.

If you’re building a theme for a client and simply want to replace the generic WordPress image, you can do that with just a few lines of code. Place them in your theme’s functions.php file:

//Change the generic login image
function custom_login_logo() {
  echo '';
}
add_action('login_head', 'custom_login_logo');

Discovered in Jo Lowery’s excellent course Dreamweaver and WordPress Core Concepts at Lynda.com.

Change the Login URL

Now that the logo says something other than WordPress, it’s probably confusion that when someone were to click, they’d still go to WordPress.org – rather than a custom URL.

Let’s fix that by adding this code:

// add custom URL to Login Logo
function custom_login_url(){
    return ('http://example.com/');
    }
    add_filter('login_headerurl', 'custom_login_url');

Happy styling!



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.