Remove X link from admin toolbar

Hi Team X,

Can you please advise how to remove the X icon and link from the admin tool bar - for some users. ie - shopmanagers.

Many thanks

Hello @Deesign,

Thanks for writing to us.

Regretfully, there is no option at the moment. It would require custom development. I would suggest you contact a developer who can assist you with your concern. Please note that we don’t provide custom development support it is out of the support scope.

Thanks for understanding

Thank you @prakash_s

I’ve tried adding css to the global theme options to achieve this goal without any luck.

/* remove X from toolbar */

#wpadminbar ul li:last-child {
box-shadow: none;
display: none !important;
}

The reason we’re asking for help is that our store manager users of X see the below page if they select the icon which has caused serious confusion for the business workflow. The admin users see something different when they select the icon.

Does the White Label extension cover items like this?

Hello @Deesign,

FYI: Please go to X > Settings > Permissions > Shop Manager and make sure to disable ALL options so that nothing will display for Shop managers.

Best Regards.

Thank you @ruenel

Followed the instructions above and disabled all macros, elements, classic elements and set all user preferences to “Always Off” for Shop Manager - but the X is still in the top menu and links to a full X Start Building page.

Hey @Deesign,

You can also do this with custom PHP code, try adding the following code in your child theme’s functions.php file:

// remove the X Icon for all other roles except Admins
function remove_x_icon() {
	if( !current_user_can('administrator') ) {
		echo '<style>
			#wp-admin-bar-tco-main {
				display: none;
		}
		</style>';
	}
}
add_action('wp_head', 'remove_x_icon');
add_action('admin_head', 'remove_x_icon');

The above code will remove the X icon for all roles except for the Admin roles. You can tweak the code to support other roles as you need.

Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Hope this helps!

2 Likes

Thank you Nabeel,

Added to global js but the X is still in the tool bar for all users :frowning:
Is there another way?

Hello @Deesign,

Please DO NOT add the code in the JS section. You need to go to Appearance > Theme Editor and find the functions.php file on the left side.

If file editing is not allowed, the Theme Editor option is not available. You will have to edit your child theme’s functions.php manually.

Best Regards.

1 Like

Perfection!

SO sorry for the misstep of code locations - I’ll do better next time :grinning:
Thanks for the hand holding! We really appreciate the ongoing support.

You are most welcome.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.