Open Menu Links in New Tabs

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

For more information about customizing the Client Area’s navigation menus, see Client Area Navigation Menus and our Developer Documentation.

You can open links in a new browser window using the setAttribute method.

For example, if you are using an external system to control your knowledge base, you could use the following code:


use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {
    $navItem = $primaryNavbar->getChild('Knowledgebase');
    if (is_null($navItem)) {
    $navItem->setAttribute("target", '_blank');

Last modified: May 28, 2024