Feature Requests
Share ideas, discuss and vote on requests from other users in community
This object is in archive! 

Allow delete of server if all hosting accounts are terminated or cancelled

Ross Gerring shared this idea 3 years ago
Under Consideration

At present (July 2017) it's not possible to delete a server in WHMCS if there are still hosting accounts associated with that server, even if they are all terminated or cancelled.

WHMCS > Setup > Products/Services > Servers > Delete (a server)

So even if the number of 'Active Accounts' in the above list is reporting 0, an attempt to delete a server where non-active (cancelled or terminated) accounts are still associated with that server will return the error message:

"An Error Occurred. You cannot delete a server while hosting accounts are still assigned to it"

Immediate cosmetic improvements to the above would be:

1. Change this error message to: "An Error Occurred. You cannot delete a server while hosting accounts are still assigned to it, even if they are cancelled or terminated".

2. As well as the existing "Active Accounts" column in the above configservers.php page, add another column that lists how many cancelled or terminated accounts are still associated with this server. Additional, make this information available as a clickable link to a report that lists out exactly which these accounts are. (This would just be a shortcut to a pre-filtered report in the clientshostinglist.php script).

I've contacted WHMCS support people about this, and their response was:

"The best workaround as you have found, would be to assign terminated and cancelled accounts to a different server, even if they are not provisioned there. If you add a false server, this can cause other problems as WHMCS will try to run the usage update part of the cron and hang on any servers it can't actually connect to."

While accepting the above as the best currently available workaround, it's not very satisfactory.

Another workaround would be to completely delete the accounts in question, but this is not ideal from an historical record-keeping perspective.

I don't have a best suggestion for this. Bottom line is that I should be able to delete a server (not just 'disable' it) when it no longer exists, and I shouldn't have to delete hosting accounts to achieve this if they've been cancelled or terminated.

If I'm missing something, or anyone has any better workarounds, I'm all ears! :-)

Thanks for your consideration,


Comments (2)


I'm on the same boat. Have removed all active accounts from server and cannot delete it from WHMCS.

Suggestion: if an account is closed, it should automatically be unlinked from any server so this situation doesn't happen where an old account may be tied to that server since closed accounts don't seem to show under the accounts data field in the server properties in WHMCS.


+1 from me. Just attempted to delete a server only to find it has terminated or cancelled accounts associated with it and so can't be removed.

Most sensible option would be to "Retire" a server rather than deleting it, so it no longer shows up on the main list and is part of a "retired" servers group instead. This way you don't have to mess around with the database too much.

Do you agree?