Changing and overriding the WordPress Admin logo

If you’re doing custom WordPress designs like I do, or simply want to improve yours and your customer’s login experience, there are many ways to simplify and customize the WordPress dashboard.

One of the ways that’s not so straightforward is the changing and overriding of the WordPress Admin logo.

Normally it looks like this:

Changing and Overriding the WordPress Admin logo before thedavebraun

Afterwords it looks like this (pardon the logo design, but that’s what my customer wants):

Changing and Overriding the WordPress Admin logo after thedavebraun

Note in the pics that I’ve already removed the WordPress logo that’s normally to the left of the admin logo.

This one article was most helpful as well as a comment in the thread:

PROTIP: When programming or figuring out something technical, read the comments as people respond with fixes to the author’s post that might just apply to you.

But it didn’t work. It got me 90% there, but not all the way.

The similar article at WP Beginner didn’t work either.

I had to modify the CSS class that was used since it apparently had changed since 3.3.1.

Code for changing and overriding of the WordPress Admin logo

Here are the steps to get this done:

  1. If you haven’t created a child theme, make sure you have one and do this in the child theme area so your changes don’t get overwritten by a theme update.
  2. Create your logo and upload it into where the child theme is, or preferable into an images directory. Use 25×27 or something close and png or gif with a transparent background.
  3. Add the below code into your functions.php.
  4. Modify it for your logo name and directory.

So how does it work?

  • We’re attaching to the admin_head hook with a new function
  • Then adding a CSS class that targets the admin bar site name, adding our logo to it.
    Setting the foreground color and opacity to “hide” the current dashicon.

Yes, there are plugins you can get that allow you to customize everything in the dashboard. I’ll probably end up using this one: for further customizations, like including training videos and such. Or simply implement this gradually myself.

But for what you want to do, why not create your own plugin with snippets and brand yourself, instead of someone else?

And doing this by changing the WordPress admin logo will help separate you from the pack.