Add a Sidebar Item

This information only applies to self-hosted WHMCS installations. WHMCS Cloud does not currently support this customization method.

You can customize the Client Area’s sidebar navigation menus through hooks and custom modules.

For more information, see Client Area Sidebars and our Developer Documentation.

Add a Sidebar Menu Item

Before adding an item to a sidebar menu, check that the sidebar exists on that specific page. You can then add more menu items using the following example code:

Example

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) {
    if (!is_null($primarySidebar->getChild('My Account'))) {
        $primarySidebar->getChild('My Account')
            ->addChild('Mailing List Subscription Prefs')
            ->setLabel('Subscription Preferences')
            ->setUri('subscriptionprefs.php')
            ->setIcon('fa-user')
            ->setOrder(100);
    }
});

Last modified: 2025 October 17