This guide is available as a video:

How to create custom WHMCS pages

In this tutorial we will show you how to create custom pages in WHMCS. This guide will focus on our Premium WHMCS Themes but should work with any WHMCS template.

Creating a custom page

Create a new .php file in the root of WHMCS. I always recommend using the page title without spaces and capitations, in this example we will create a page named windows-hosting.php. This file needs to contain the following code (as provided by WHMCS):


use WHMCS\Authentication\CurrentUser;
use WHMCS\ClientArea;
use WHMCS\Database\Capsule;

define('CLIENTAREA', true);

require __DIR__ . '/init.php';

$ca = new ClientArea();

$ca->setPageTitle('Windows Hosting');

$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));
$ca->addToBreadCrumb('windows-hosting.php', 'Windows Hosting');


//$ca->requireLogin(); // Uncomment this line to require a login to access this page

// To assign variables to the template system use the following syntax.
// These can then be referenced using {$variablename} in the template.

//$ca->assign('variablename', $value);

$currentUser = new CurrentUser();
$authUser = $currentUser->user();

// Check login status
if ($authUser) {

     * User is logged in - put any code you like here
     * Use the User model to access information about the authenticated User

    $ca->assign('userFullname', $authUser->fullName);

    $selectedClient = $currentUser->client();
    if ($selectedClient) {

         * If the authenticated User has selected a Client Account to manage,
         * the model will be available - put any code you like here


} else {

    // User is not logged in
    $ca->assign('userFullname', 'Guest');


 * Set a context for sidebars
 * @link

 * Setup the primary and secondary sidebars
 * @link

# Define the template filename to be used without the .tpl extension



Note the Windows Hosting, windows-hosting.php and windows-hosting references. These should be changed based on the page you'd like to create.

Create the .tpl page

The last file to be created is a template file (.tpl), this will contain the content of your custom page. It needs to be named exactly in line 35 of the above code but with the .tpl extension. So in this case it is windows-hosting.tpl. This file needs to be created in the following directory:


Your new page can contain any HTML content you like, for example:

<h2>This is a page title</h2>
<p>This is a paragraph</p>

View the new page

The new page will now be viewable at:

Developing Your New Page

Content needs to be added to the .tpl file of your custom page, this content can be in the form of HTML.

HTML Snippets

Your WHMCS Template comes with a wide selection of ready-made HTML Snippets allowing you to easily generate pre-integrated and fully responsive elements for your new pages. Elements include feature boxes, pricing tables, buttons & more.

HTML Snippets

Adding Your Page To The Menu

Now you have created your new page you may wish to add a link to it within the template. Click the button below for more information on how to do this.

Editing The Menu


If you have any questions please leave a comment below or contact our support.