Remove WordPress Admin Bar Link For Non Adminstrators

Add Tool

Remove WordPress Admin Bar Link For Non Adminstrators


Remove WordPress Admin Bar Link For Non Adminstrators

In the WordPress Dashboard, besides the main menu on the sidebar, you will also find a couple of menu links at the top. You can restrict access to WordPress admin bar link from specific roles or users. This snippet below will Remove WordPress Admin Bar Link For Non Adminstrators.

Remove WordPress Admin Bar Snippets

function remove_admin_bar_links() {
    global $wp_admin_bar;
    if (!current_user_can('administrator')) {
        $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('site-name');        // Remove the site name link
        $wp_admin_bar->remove_menu('view-site');        // Remove the visit site link
        $wp_admin_bar->remove_menu('updates');          // Remove the updates link
        $wp_admin_bar->remove_menu('comments');         // Remove the comments link
        $wp_admin_bar->remove_menu('new-content');      // Remove the new content link
        $wp_admin_bar->remove_menu('my-account');       // Remove the user details tab
    }
}
add_action('wp_before_admin_bar_render', 'remove_admin_bar_links');

Tags: Wordpress Admin Bar, Remove WordPress Admin Bar, Wordpress Admin Bar Customize, Wordpress Admin Bar Plugin, Wordpress Admin Bar Bottom
Payza

About Masum Billah

Remove WordPress Admin Bar Link For Non Adminstrators 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: Remove WordPress Admin Bar Link For Non Adminstrators


adf.ly