Hello @diana52, thanks for reaching out with your question regarding disabling the Site Kit stats from the toolbar for specific user roles. There are a few ways you can achieve this:
- Using dashboard sharing to share a restricted view of the Site Kit dashboard, WordPress dashboard summary widget, and toolbar with other user roles. Just select which module stats you’d like to share with which user roles.
- It can be disabled for a user profile from Administration > Users > Your Profile > Show Toolbar when viewing the site. This will disable the entire toolbar and not just the Site Kit stats in it. The Site Kit stats in the toolbar can be disabled entirely by an administrator by going to Site Kit > Settings > Admin Settings > Display relevant page stats in the Admin bar.
- Using a filter which you can use to do this and specify user roles you’d like to exclude the Site Kit toolbar from. Here is an example of the filter for this which would exclude this for all editiors:
add_filter( 'googlesitekit_show_admin_bar_menu', function( $show ) { return current_user_can( 'editor' ) ? false : $show; });
This filter can be added to your functions.php file. If you need assistance with doing that then reach out to your hosting provider who should be able to help you do that.
I hope this helps with your question and one of the solutions works for you. If you have any further questions then please let me know and I will be happy to help!