There are a few different ways to hide the WordPress admin bar when logged in, using either a plugin or code.

  1. Use a plugin: There are several plugins available that allow you to hide the admin bar, such as "Admin Bar Control", "Disable Admin Bar", and "Simple Admin Bar Removal". Simply install and activate one of these plugins, and the admin bar will be hidden on the front-end of your site.

  2. Use code: You can also hide the admin bar using code by adding the following code snippet to your theme's functions.php file:

add_filter('show_admin_bar', '__return_false');

Additionally, you can also use CSS to hide the admin bar. Add the following code snippet to your theme's style.css file:

 
#wpadminbar { display: none; }

Please note that, before making any changes to the code, it's highly recommended to backup your site and use a child theme, so that your changes will be preserved when updating the main theme.

Also, you can use a plugin like "Custom CSS and JS" to add the CSS code, which will allow you to keep your custom CSS separate from the theme's CSS, and it won't get lost when theme updates.

War diese Antwort hilfreich? 2 Benutzer fanden dies hilfreich (41 Stimmen)