> For the complete documentation index, see [llms.txt](https://developers.weglot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.weglot.com/wordpress/use-cases/how-to-hide-the-weglot-admin-button-for-non-administrator-roles.md).

# How to hide the Weglot admin button for non administrator roles

```php
if(is_user_logged_in()){
	$user = wp_get_current_user();
	if ( !in_array( 'administrator', (array) $user->roles ) ) {
		add_action( 'admin_head', 'hide_wg_button' );
	}
}

function hide_wg_button() {
 echo "<style>#wp-admin-bar-weglot{display:none;}</style>";
}
```
