How to remove the WordPress logo from the admin bar

By default WordPress displays it’s logo on the far left site of the admin bar with some quick links to WordPress, documentation, news, etc. As I don’t use them and sometimes click there by accident I usually remove them from my websites. Also it’s less confusing for clients or editors if they have access to the backend as it’s less confusing for them.

The process is very simple as you just have to add the following code snippet to your theme’s functions.php. After a reload the logo and quicklinks should be gone from the WordPress admin bar.

function admin_bar_remove_logo() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu( 'wp-logo' );
add_action( 'wp_before_admin_bar_render', 'admin_bar_remove_logo', 0 );