Limiting messaging capabilities doesn't work

Hi there,

I added the capabilities addon for the wpmudev private messaging plugin, but users with the role "coachee" can still send messages to other coachees despite having limited it to admins. What am I missing?

And have you an hint on how to disable the autocomplete in the 'send to' field when composing a message?

Many thanks!


  • Florian
    • Flash Drive

    Oh I see! Users of the same group can always message one another.

    But then: how do I remove the "compose" button? I want users to only be able to reply to messages that they received via the message option where the admin specifies the recipient in the short code.

    Custom CSS?

    Kind regards,

  • Sajid
    • DEV MAN’s Sidekick

    Hi @Florian,

    Hope you are doing good today :slight_smile:

    Yes, you can remove the compose button using custom CSS and also hide this dynamically for non-admin users by using the following code snippet.

    add_action( 'admin_bar_menu', 'wpmu_remove_compose_button', 999 );
    function wpmu_remove_compose_button( $wp_admin_bar ) {
    	if(current_user_can('administrator') ) return;
    	$wp_admin_bar->remove_node( 'mm-compose-button' );

    This will hide the compose button in WordPress admin bar as seen in attached screenshot.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:
    Cheers, Sajid

  • Florian
    • Flash Drive

    Ok, I figured I have to create a mu plugin. Got the part of hiding the "send message" in the toolbar working. But still struggle with hiding the "compose" button in the inbox of the wpmudev private messaging plugin.

    Would be great if you could help me out quickly!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.