Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove WP Admin Bar Extras
// ADMIN BAR UPDATES
function hg_remove_admin_bar_links()
{
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo'); // Remove the WordPress logo
$wp_admin_bar->remove_menu('about'); // Remove the about WordPress link
$wp_admin_bar->remove_menu('wporg'); // Remove the WordPress.org link
$wp_admin_bar->remove_menu('documentation'); // Remove the WordPress documentation link
$wp_admin_bar->remove_menu('support-forums'); // Remove the support forums link
$wp_admin_bar->remove_menu('feedback'); // Remove the feedback link
$wp_admin_bar->remove_menu('updates'); // Remove the updates link
$wp_admin_bar->remove_menu('comments'); // Remove the comments link
}
add_action( 'wp_before_admin_bar_render', 'hg_remove_admin_bar_links' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment