Hide admin menu in WordPress

When using WordPress, a black bar (Admin Bar) is always displayed at the top.

WordPress allows users to register, and to Hide admin menu for regular members, you need to add the following line to the function.php file located in the folder of the theme you are using.

Hide admin bar

It activates the ‘after_setup_theme’ hook when the theme is read and executes the ‘remove_admin_bar’ function, which hides the admin menu.

Sentence to paste

 /*Hide admin bar for regular members*/
  add_action('after_setup_theme', 'remove_admin_bar');
  function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
      show_admin_bar(false);
    }
  } 

Updated : March 20, 2020
{{ reviewsTotal }}{{ options.labels.singularReviewCountLabel }}
{{ reviewsTotal }}{{ options.labels.pluralReviewCountLabel }}
{{ options.labels.newReviewButton }}
{{ userData.canReview.message }}
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.