Top Menu

WordPress Admin Bar Customization Without Using Plugins


Admin Toolbar or Admin Bar is a part of WordPress admin dashboard or front end which i personally don’t like much. Some of the options provided in the admin bar are already present in the sidebar menu. So it’s not a good idea to put same content to the dashboard twice.

Here is the complete list of code snippet which helps you to customize admin bar for you. Place the code in theme function file functions.php.

1. Completely Removing Admin Bar from Admin Dashboard Page

With Admin Bar WordPRess

Below code will disable the admin bar from admin dashboard. Copy and paste the code to your functions.php. Usually before the ?> in your function file.

//Completely Removes Admin Bar from Admin Page
remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 ); // For admin page

// CSS override for the admin page
function remove_admin_bar_style_backend() {
echo '';
    }
add_filter('admin_head','remove_admin_bar_style_backend');

without-admin-bar

2. Completely Removing Admin Bar from Front End

With Admin Front End

Below code snippet removes admin bar/ toolbar from front end of your site.


//Completely Removes Admin Bar from Front End Site
remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); // For front end

// CSS override for the frontend
function remove_admin_bar_style_frontend() {
echo '';
    }
add_filter('wp_head','remove_admin_bar_style_frontend', 99);

without admin front end bar

Thanks to TutsPlus

3. Customizing Admin Bar Links One By One

Please modify according to your need and use the below code if you want to retain some of the links. Please go through each and every comments which explains you which link removes after inserting the line of code. Just comment out or delete the line if you want to retain the link in admin bar.


function blgs_rnb_remove_admin_bar() {
    global $wp_admin_bar;

	//Remove WordPress Logo Menu Items
    $wp_admin_bar->remove_menu('wp-logo'); // Completely Removes WP Logo, Below are the individual items
    $wp_admin_bar->remove_menu('about');   // 'About WordPress'
    $wp_admin_bar->remove_menu('wporg');   // 'WordPress.org'
    $wp_admin_bar->remove_menu('documentation');  // 'Documentation'
    $wp_admin_bar->remove_menu('support-forums');  // 'Support Forums'
    $wp_admin_bar->remove_menu('feedback');       // 'Feedback'

    //Remove Site Name Items
	$wp_admin_bar->remove_menu('site-name'); // Completely Removes Site Name from Dashboar and Front End Admin Bar, Below are the individual items
	$wp_admin_bar->remove_menu('view-site'); // 'Visit Site'

	$wp_admin_bar->remove_menu('dashboard'); // 'Dashboard' Link, Only Front End
	$wp_admin_bar->remove_menu('themes'); // 'Themes' Link, Only Front End
	$wp_admin_bar->remove_menu('widgets'); // 'Widgets' Link, Only Front End
	$wp_admin_bar->remove_menu('menus'); // 'Menus' Link, Only Front End

	// Remove Comments Bubble
	$wp_admin_bar->remove_menu('comments');

	//Remove Update Link if theme/plugin/core updates are available
	$wp_admin_bar->remove_menu('updates');

	//Remove '+ New' Menu Items
	$wp_admin_bar->remove_menu('new-content'); // Completely Removes '+ New' from Dashboar and Front End Admin Bar, Below are the individual items
	$wp_admin_bar->remove_menu('new-post');   // 'Post' Link
	$wp_admin_bar->remove_menu('new-media');   // 'Media' Link
	$wp_admin_bar->remove_menu('new-link');   // 'Link' Link
	$wp_admin_bar->remove_menu('new-page');   // 'Page' Link
	$wp_admin_bar->remove_menu('new-user');   // 'User' Link

	// Remove 'Howdy, username' Menu Items
	$wp_admin_bar->remove_menu('my-account');  // Completely Removes 'Howdy, username' and Menu Items
	$wp_admin_bar->remove_menu('user-actions');  // Completely Removes Submenu Items Only
	$wp_admin_bar->remove_menu('user-info'); // 'username' which links to profile page
    $wp_admin_bar->remove_menu('edit-profile');  // 'Edit My Profile' Link
	$wp_admin_bar->remove_menu('logout');  // 'Log Out' Link

}
add_action( 'wp_before_admin_bar_render', 'blgs_rnb_remove_admin_bar' );

Best Items - Top e-Commerce WordPress Plugins

Find 61+ top notch e-Commerce WordPress plugins - Paypal, Jigoshop, Amazon, WooCommerce, Credit Card Gateway and Authorize etc.
FIND OUT MORE

Best Items - Recommended WordPress and Web Development Books

Want to learn IN and OUT of web development and become professional web developer? Here are the list of WordPress and Web Development books which i recommend you to start with.
FIND OUT MORE

Best Items - Top Selling WordPress Themes From Themeforest

Want to use one of the top selling WordPress theme for your next project?   Here is the list of Premium WordPress items from Blog, Magazine, Creative, Retail, Technology, Entertainment, BuddyPress, eCommerce and Nonprofit categories.
FIND OUT MORE

Best Items - Top notch Premium BuddyPress Themes

Are you looking for best premium WordPress themes which are BuddyPress ? Head over to Premium BuddyPress Themes for top quality and responsive designs.
FIND OUT MORE

Best Items - Best Real Estate WordPress Themes

Need to design Real Estate Website for your client ? These collection can make your life easy while developing Real Estate websites for your client. Choose from wide verity of WordPress templates and make your own unique design.
FIND OUT MORE

Best Items - Best WordPress Templates Made for Mobile and Tablet Visitors

Collection of Premium WordPress templates to take your website to the next level. Use these themes on your project to reach out Mobile and tablet users. Grow your business and traffic instantly.
FIND OUT MORE

Best Items - Best Gallery WordPress Plugins

Find most downloaded WordPress Gallery plugins - Video, Thumbnail and Photo Gallery etc...
FIND OUT MORE

Best Items - Start Your Own Community Website Like Facebook In a Minute

Want to start your own social or community website like Facebook ? Start right away using Buddypress WordPress plugin along with premium Buddypress Themes. No need to setup anything. It works out of box. Install BuddyPress plugin and Premium themes from this list. Your are done!.
FIND OUT MORE

, , ,

  • Elaustralopithecus

    Hello, it works ! keep working and show us more trick
    Gus