Matomo whitelabel - remove menu items for non-super users

So I have a client and I have prepared matomo, I have the white label plugin and what’s left is to remove 3 more elements. The elements are attached in the images below:

So basically I want to remove the newsletter signup which is under Personal → Settings

i want to remove woocommerce which is under websites and I want to remove API which is under platform.

Can anyone point me on where to find menu keys for matomo to remove these?

I found an answer here: How to code a plugin that hides menu items from non-superadmins_ - #2 by Lukas

And I have this: https://developer.matomo.org/guides/menus

I tried this solution:

<?php
namespace Piwik\Plugins\HideMenus;

use Matomo\Menu\MenuAdmin;
use Matomo\Menu\MenuTop;
use Piwik\Piwik;

class Menu extends \Matomo\Plugin\Menu
{
    public function configureAdminMenu(MenuAdmin $menu): void
    {
        if (Piwik::hasUserSuperUserAccess()) {
            return;
        }

        // Hide API under Platform
        $menu->remove('Platform_Platform', 'API');

        // Hide WooCommerce under Websites
        $menu->remove('Websites', 'WooCommerce');

        // Optionally hide Diagnostic if you want
        // $menu->remove('Diagnostic_Diagnostic', 'Diagnostic_Diagnostic');
    }

    public function configureTopMenu(MenuTop $menu): void
    {
        // You can remove top menu items if needed (e.g., Marketplace)
        // Example: $menu->remove('CorePluginsAdmin_MenuPlatform', 'Marketplace_Marketplace');
    }
}

But it doesn’t work.

Can anyone help please?

UPDATE ON THIS:

I currently have this code:

<?php
namespace Piwik\Plugins\ZZHideMenus;

use Matomo\Menu\MenuAdmin;
use Piwik\Piwik;

/**
 * Hides WooCommerce (Websites section) and API (Platform section)
 * for every user that is **not** a Super User.
 */
class Menu extends \Piwik\Plugin\Menu
{
    public function configureAdminMenu(MenuAdmin $menu): void
    {
        // keep the full UI for Super Users
        if (Piwik::hasUserSuperUserAccess()) {
            return;
        }

        /* ------------------------------------------------------------------
         * 1.  Websites  →  WooCommerce
         *     parent token : SitesManager_Sites
         *     child  token : WooCommerce
         * ------------------------------------------------------------------ */
        $menu->remove('SitesManager_Sites', 'WooCommerce');

        /* ------------------------------------------------------------------
         * 2.  Platform  →  API
         *     parent token : CorePluginsAdmin_MenuPlatform
         *     child  token : General_API
         * ------------------------------------------------------------------ */
        $menu->remove('CorePluginsAdmin_MenuPlatform', 'General_API');
    }
}

The code above removes the API from the menu:

However the WooCommerce is still visible under Websites:

For context, I created a plugin called ZZHideMenus, you can see the folder structure:

Screenshot 2025-05-25 at 14.59.44

Inside the folder i have 2 files, one json and other menu php, menu php you already saw above, and below is the content of the json file:

{
  "name": "ZZHideMenus",
  "version": "1.0.4",
  "description": "Hide WooCommerce & API menu items for non-super-users",
  "license": "GPL v3+",
  "matomo": ">=5.0.0",
  "theme": false
}

If anyone can help me figure out how to remove the woocommerce from menu that would be great.

Thank you

Another update, so to remove the WooCommerce from the menu, I had to go inside the plugin itself, I opened the menu.php which contains this:

<?php

/**
 * Copyright (C) InnoCraft Ltd - All rights reserved.
 *
 * NOTICE:  All information contained herein is, and remains the property of InnoCraft Ltd.
 * The intellectual and technical concepts contained herein are protected by trade secret or copyright law.
 * Redistribution of this information or reproduction of this material is strictly forbidden
 * unless prior written permission is obtained from InnoCraft Ltd.
 *
 * You shall use this code only in accordance with the license agreement obtained from InnoCraft Ltd.
 *
 * @link https://www.innocraft.com/
 * @license For license details see https://www.innocraft.com/license
 */

namespace Piwik\Plugins\WooCommerceAnalytics;

use Piwik\Menu\MenuAdmin;
use Piwik\Piwik;

class Menu extends \Piwik\Plugin\Menu
{
    public function configureAdminMenu(MenuAdmin $menu)
    {
        if (Piwik::isUserHasSomeAdminAccess()) {
            $menu->addMeasurableItem('WooCommerce', $this->urlForAction('install'));
        }
    }
}

I changed this line:

if (Piwik::isUserHasSomeAdminAccess())

to this line:

if (Piwik::hasUserSuperUserAccess())

And this has fixed it finally after 24 hours spent on this.

Hopefully someone will find this useful.

Last step is to remove the newsletter signup which is located under Personal → Settings:

If anyone can help with this I would appreciate it.