How to Remove Logo from WordPress Admin Bar

To remove the logo from the WordPress admin bar, you can use CSS to hide or disable it. Here’s how you can achieve this:

1. Open the theme’s functions.php file in your WordPress theme directory.
2. Add the following code to the file:

// Remove logo from WordPress admin bar
function remove_admin_bar_logo() {
    echo '<style>
        #wpadminbar #wp-admin-bar-wp-logo {
            display: none !important;
        }
    </style>';
}
add_action('wp_head', 'remove_admin_bar_logo');

 

3. Save the changes and upload the modified functions.php file back to your server.

This code adds an inline CSS style to hide the logo element in the WordPress admin bar. The `#wp-admin-bar-wp-logo` selector targets the logo element specifically.

After making these changes, the logo in the WordPress admin bar will be hidden or removed. Please note that this solution affects the visual display only and does not disable any functionality related to the logo.

 

 

To remove the logo from the WordPress admin bar using the `remove_node` method, you can use the `admin_bar_menu` hook along with the `remove_node` function. Here’s how you can achieve this:

1. Open the theme’s functions.php file in your WordPress theme directory.
2. Add the following code to the file:

 

// Remove logo from WordPress admin bar
function remove_admin_bar_logo($wp_admin_bar) {
    $wp_admin_bar->remove_node('wp-logo');
}
add_action('admin_bar_menu', 'remove_admin_bar_logo', 999);

 

3. Save the changes and upload the modified functions.php file back to your server.

This code uses the `admin_bar_menu` hook to modify the WordPress admin bar menu. The `remove_node` function is used to remove the node with the ID `’wp-logo’`, which represents the logo element in the admin bar.

After making these changes, the logo in the WordPress admin bar will be removed.

Please note that this solution removes the logo element from the admin bar completely, including its functionality and any associated sub-menus.

 

[TheChamp-Sharing]

Related Blogs

How to add ACF options pages and options sub page

To add Advanced Custom Fields (ACF) options pages and options sub-pages, you’ll need to have ACF Pro installed and activated on your WordPress site. ACF Pro allows you to create custom options pages where you can add settings, fields, and other configuration data.

WooCommerce: Check if Product Category is in the Cart

To check if a specific product category is in the cart during the `woocommerce_before_cart` action hook, you can use a similar approach as in the previous answer. However, in this case, you need to use the `woocommerce_before_cart_contents` action hook, which fires before the cart items are displayed on the cart page. Here’s how you can achieve this:

Request A Quote

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.