Skip to content

Instantly share code, notes, and snippets.

@palimadra
Created July 1, 2012 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save palimadra/3028986 to your computer and use it in GitHub Desktop.
Save palimadra/3028986 to your computer and use it in GitHub Desktop.
Remove menu items from WordPress admin bar
function wps_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
$wp_admin_bar->remove_menu('about');
$wp_admin_bar->remove_menu('wporg');
$wp_admin_bar->remove_menu('documentation');
$wp_admin_bar->remove_menu('support-forums');
$wp_admin_bar->remove_menu('feedback');
$wp_admin_bar->remove_menu('view-site');
}
add_action( 'wp_before_admin_bar_render', 'wps_admin_bar' );
@palimadra
Copy link
Author

If you want to remove the menu items from the admin bar for WordPress add this code to the functions.php file in the theme folder of the theme you are using.

Be careful to include the code in PHP tags . In case of some themes the php tags might have to be added and in others they are not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment