How to remove WordPress logo on the login page and on the admin bar

Home » Blog » WordPress Development » How to remove WordPress logo on the login page and on the admin bar

If you create WordPress websites for your clients, then you might want to remove the WordPress logo from the admin bar and the login page. This lets you white-label, and sell WordPress sites as your own.

How To Remove WordPress Logo From Admin Bar

If you want to remove the small WordPress logo icon you see in the admin bar, all you need is this PHP snippet.

Copy and paste this snippet into your theme’s functions.php file:

// Remove the WordPress logo from the admin bar.
function wpturbo_remove_admin_bar_wp_logo() {
	global $wp_admin_bar;
	// Remove the wp-logo item from the admin bar.
	$wp_admin_bar->remove_menu('wp-logo');
}

add_action('wp_before_admin_bar_render', 'wpturbo_remove_admin_bar_wp_logo', 0);

The above code adds a new function to the ‘wp_before_admin_bar_render’ hook. The WordPress logo in the admin bar is a menu item, and this function will remove that menu item called ‘wp-logo’ from the admin bar menu.

If you don’t want to add this snippet to your theme’s functions.php file, you can create a site-specific custom plugin. Use our plugin header generator to generate a plugin file, then add this code to it. It’s a much better idea to create a custom plugin and add all your snippets to it. This way, you won’t lose any snippets you are using when you change your theme or when it gets updated.

How To Remove WordPress Logo From Login Page

To remove the big WordPress logo you see on the login page, all you have to do is add this simple snippet to your theme’s functions.php file:

// Remove WordPress Logo From The Login Page.
function wpturbo_remove_wp_logo_from_login_page() {
?>
	<style type="text/css">
		.login h1 a { display: none; }
	</style>
<?php
}

add_action( 'login_enqueue_scripts', 'wpturbo_remove_wp_logo_from_login_page' );

The above code adds a function to the ‘login_enqueue_scripts’. This function will add a small CSS snippet to your login page. This CSS snippet will add a ‘display: none;’ property to the logo to make it invisible.

Conclusion

If you are building websites for your clients, you’ll want to disable the WordPress logo in the Admin Bar and on the login page. The above two snippets are all you need to do that.

Use our plugin header snippet generator to generate a starter plugin file and then add these two scripts to it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Register an account to save your snippets or go Pro to get more features.