Domain Categories

From WHMCS Documentation

This page describes a feature available in version 7.10 and above.

What are domain categories?

Domain categories are used in the Client Area to group domain TLDs into categories such as Popular, Shopping, or Real Estate. They make it easier for clients to navigate and find their ideal domain extensions.

How do I customise domain categories?

The domain categories that WHMCS ships with by default can be found in /resources/domains/dist.categories.json. Do not edit this file.

To add or edit domain category definitions, begin by creating a custom JSON file at /resources/domains/categories.json. This file must only contain valid JSON. In this file, define the domain categories you want to use. This file remains in place when you update WHMCS, ensuring that your customizations are not altered by the upgrade process.

TLDs can appear in multiple categories; for example, a UK-based company might include the .uk and .co.uk TLDs in the Popular category as well as a Local Geographic category.

Adding a TLD or Category

In your custom /resources/domains/categories.json file, add a section that resembles this example:

{
  "Domains A-F": [
    ".biz",
    ".ca",
    ".com",
    ".co.uk",
    ".de",
    ".eu"
  ]
}

This example adds a domain category called "Domains A-F" with several TLDs.

A domain category definition is simply the category name, with an array of the domain TLDs which should be included in that category.

Removing a TLD from a default TLD Category

Inside your custom /resources/domains/categories.json file, add a section that resembles this example:

{
  "REMOVE": {
    "Popular": [
      ".com",
      ".net"
    ]
  }
}

This example removes the .com and .net TLDs from showing in the default Popular category.

Additions and Removals

If you want to both create and add to new categories while removing TLDs from default categories, you will need to place both the additions and removals in the same set of curly braces. For example:

{
  "Domains A-F": [
    ".biz",
    ".ca",
    ".com",
    ".co.uk",
    ".de",
    ".eu"
  ],
  "REMOVE": {
    "Popular": [
      ".com",
      ".net"
    ]
  }
}

Category Dynamic Translations

To set a Client Area category name that matches the visitor's chosen language, see our Language Overrides Developer Documentation.

Using the below example, you can add an override string to each language file:

$_LANG['domainTldCategory']['Money and Finance'] = "Geld und Finanzen";

Adding this example to the german.php language override file translates the Money and Finance category name into the German language.