Support » Plugins » Hacks » Remove theme options link from admin bar

  • Resolved pjbursnall



    I am customising an admin panel for a client, using the AG Custom Admin plugin. The only thing I can’t disable is the theme options link which sits to the left of ‘New’ link (for post, media, page) on the admin bar. How can I hide this?

    I know I could disable the admin bar but I’d rather just remove the theme options link.


Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator bcworkz


    Use the remove_node() method of the WP_Admin_Bar object.

    Thanks for the advice, maybe I haven’t got it quite right though. I’ve added this to the theme functions.php but the link still remains:

    add_action( 'admin_bar_menu', 'remove_customer_support', 999 );
    function remove_customer_support( $wp_admin_bar ) {
    	$wp_admin_bar->remove_node( 'customer_support' );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    I’ve tested the same with site-name and it works so I’m not sure what I’ve got wrong?


    Moderator bcworkz


    That snippet should work for you AFAICT. Some possible avenues of investigation: You could try a var_dump of $wp_admin_bar->nodes to ensure you’ve got the ID right. You may need to die() afterwards to see the dump. If it’s not in that array, it somehow managed to get added after your callback is run. Find the code that adds it and figure out why.

    There could be some sort of conflict with one of your plugins. Try disabling them and see if the node is then removed. That’s about the only things I can think of that would cause failure.

    I’ll try disabling plugins, then update. The node id is definitely correct, I’ve confirmed that earlier…


    No, even with all plugins deactivated ‘theme options’ remains in the toolbar. WP can be incredibly frustrating at times when considering how things look from a clients point of view.


    Ah, solved! And I could of done it much earlier. The code that added the link was in the function.php file already. Commented out now and the link is gone 🙂

    Thanks for your help,

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove theme options link from admin bar’ is closed to new replies.