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
    CSS @supports

    Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn't been available within CSS.  What we end up doing is repeating the same properties multiple times with each browser prefix.  Yuck.  Another thing we...

  • By
    Write Simple, Elegant and Maintainable Media Queries with Sass

    I spent a few months experimenting with different approaches for writing simple, elegant and maintainable media queries with Sass. Each solution had something that I really liked, but I couldn't find one that covered everything I needed to do, so I ventured into creating my...

Incredible Demos

  • By
    Build a Calendar Using PHP, XHTML, and CSS

    One of the website features my customers love to provider their web users is an online dynamic calendar. An online calendar can be used for events, upcoming product specials, memos, and anything else you can think of. I've taken some time to completely...

  • By
    Face Detection with jQuery

    I've always been intrigued by recognition software because I cannot imagine the logic that goes into all of the algorithms. Whether it's voice, face, or other types of detection, people look and sound so different, pictures are shot differently, and from different angles, I...

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!