Disable BuddyPress group deletion by Non Site Admin

We received this question from Andre? How would you disable the BuddyPress group deletion by group admins and only allow site admins to delete a group? I believe, It may be helpful for others, so posting the code here

Disabling the delete option in the Group -> Manage screen:-

In the above code we check that we are on a group page and if the current user is not site admin, we remove the “delete” from the manage screen. Here is a screenshot:-


The above code works but there is a problem. When you click on”Manage”, It will give 404 as the redirect to the default sub nav is stopped. It seems there is a bug in BuddyPress that removes the screen callback. The solution, we reattach it again. Here is our final, updated code.

That’s it. Put this code in your bp-custom.php and the future of all BuddyPress groups now depends on you, the site admin 🙂

2 Responses to Disable BuddyPress group deletion by Non Site Admin

  • Thank you very much! I’m going to link this to my Buddypress.org post and will be making a contribution to your site for this assistance. Best – Andre

Leave a Reply

Are you looking for support?

Please ask support questions in BuddyDev Forum and help us serve you better. Please use comment for general discussion/feature suggestions.

Your email address will not be published. All the fields marked as * are required.

If you are posting code, please use <pre> { Your Code Block } </pre>. Example:- <pre> echo $name; </pre>

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">