Do you want to hide the admin bar for registered users? Admin bar may be unnecessary for the membership sites, eCommerce stores or any other website that offers user registration to the general public. You can add the following code to the functions.php file of your WordPress theme to only show admin bar to administrators of the site.
<?php // Snippet code goes here! if (!current_user_can('administrator')) : show_admin_bar(false); endif; ?>
We hope this code helped you show admin bar to administrators only. You may also want to check out our guide on remove the WordPress logo from the admin bar.