Skip to main content

WordPress Tutorial: Custom Login Logo

Creating a branded experience for your clients is important as it adds value to the finished product and makes the user experience more refined.

The standard WordPress admin login panel uses a generic WordPress logo which links to WordPress.org. This isn't ideal as it is confusing for editors and users alike.

By adding the following code to your themes functions.php file you can provide your own logo which links to the your sites home page.

add_action('login_head',  'custom_login_logo');
function custom_login_logo()
{
    echo '<style type="text/css">body.login{ background: #fff; } #login{ padding: 40px 0 0; } .login h1{ margin-bottom: 20px;} .login h1 a {  background-image:url(' . get_template_directory_uri() . '/style/images/logo.png)  !important; background-size:268px 52px; padding-bottom: 0; } </style>';
}

// CUSTOM ADMIN LOGIN LOGO LINK
add_filter('login_headerurl', 'login_url');
function login_url()
{
    return site_url();
}

Simply change the location and dimensions in the code to match your site's logo and away you go!

Looking for Expert WordPress or Drupal development?

I am a freelance website developer and designer based in the UK. I work as a remote Drupal developer, WordPress developer and Front-end developer for a variety of startups, charities and international businesses in Bristol, Bath, London and Europe. You can learn more about me by visiting my resume page.

Get in touch for a free quote on your next project and if you want to connect me with then check out my LinkedIn profile.