How to Change the WordPress Admin Login Logo

By  on  

There are numerous content management systems that thrive these days but none are as prolific as WordPress. Every client wants the ability to change their website at a moment's notice and they want to do it themselves, and again, WordPress is the best fit for that. You fit the client with WordPress, customize it with plugins for the features they need, and give them the login URL...where they would see a WordPress logo...which cheapens the work you've done. Going the extra mile to customize the admin interface for your client will make a world of difference, the most prominent of changes is showing the client's logo at the admin login screen.

The logo displayed at the admin login screen is an image but it's displayed via CSS background-image. To change that image, you'll need to change a CSS selector within admin, and the safest way to do that is with a custom WordPress admin stylesheet:

// Update CSS within in Admin
function admin_style() {
  wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin.css');
}
add_action('admin_enqueue_scripts', 'admin_style');

The selector that WordPress uses or the log is .login h1 a, so to safely change the logo, the following specificity update is a good bet:

body .login h1 a {
  background-image: url('path/to/client-logo.png');
}

The CSS snippet above will change the default WordPress logo to an image of your choosing. You may need to adjust background-size dimensions to ensure the image displays correctly.

Most clients wont have a concept of what WordPress is, nor should they need to -- they simply want a website admin panel that looks like it was made just for them...and branding is the easiest way to do that.

Recent Features

  • By
    Conquering Impostor Syndrome

    Two years ago I documented my struggles with Imposter Syndrome and the response was immense.  I received messages of support and commiseration from new web developers, veteran engineers, and even persons of all experience levels in other professions.  I've even caught myself reading the post...

  • By
    I’m an Impostor

    This is the hardest thing I've ever had to write, much less admit to myself.  I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life.  All of those feelings were very...

Incredible Demos

Discussion

  1. Vladimir

    This is work for me:

    function admin_style() {
        wp_enqueue_style('admin-styles', get_template_directory_uri().'/css/admin.css');
    }
    add_action('login_enqueue_scripts', 'admin_style');
    
    body.login #login h1 a {
        background-image: url('../img/logo.png');
    }
    
  2. Thank you for sharing an amazing guide for changing logo.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!