Support » Plugin: Activity Log » How to hide this for non-admins?

  • Hi I need to hide this from the admin menu for any user that is not an administrator, please could you provide some code for this or add it as an option to the settings? It does not provide useful functionality to editors and contributors but it does clutter up the interface and make it more challenging to approach/use for novices.


    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I came here today looking for this exact solution. I had a customer who is a “shop manager” on the site (with WooCommerce) and was bugging me about “what is this activity log thing that I can’t access?” They think the site is broken.

    I wish NOT to use a plugin for this, but rather hard code it in child theme or custom functions.

    I ended up using this function:

    // Remove tools & activity log metabox from dashboard for <= editors
    function TRIM_ADMIN_MENU() {
        global $current_user;
        if(!current_user_can('administrator')) {
            remove_menu_page( 'tools.php' ); // No tools for <= editors
            @remove_menu_page( 'activity_log_page' ); // Activity log
    add_action('admin_init', 'TRIM_ADMIN_MENU');
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.