Rename the Admin Directory

Customizing the name of your WHMCS admin directory makes it harder for bots and other malicious users to find the login URL for your WHMCS Admin Area.

To do this, you must create the custom directory and update WHMCS’s configuration to use it successfully.

We recommend performing this task and other security measures immediately after installing WHMCS. For a full list, see Enhancing Security.
If you see errors after completing this process, see Admin Directory Errors.

Rename the Admin Directory

When you move the admin directory, you must also update WHMCS’s configuration to use it successfully.

To do this:

1. Update the configuration.php file.

Open the configuration.php file in your WHMCS installation’s root directory.

Add the following line to the bottom of the file before the ?>, where example is the name of the new admin directory (not the full directory path):

$customadminpath = "example";

The admin directory name can only contain alphanumeric characters (a-z and 0-9), hyphens (-), and underscores (_) and it must exist within the WHMCS installation’s root directory.

Then, save and close the file.

For more information about updating the configuration.php file, see The configuration.php File.

2. Rename the admin directory to use the new name.

Rename the admin directory to use the name that you specified for the $customadminpath value above.

Applying Upgrades and Patches

Applying updates or patches after customizing your admin directory location requires additional step. You must upload any updated files from the default admin directory in the distribution’s .zip files to your custom admin directory.

If you do not move the files, you will see errors when you attempt to access the Admin Area.

Last modified: June 14, 2024