Jump to content

Bulk removing clients from a client group


Recommended Posts

  • WHMCS Technical Analyst

Having clients organized into groups offers some great benefits ranging from being able to identify certain level of clients, to offering automatic group discounts. If you ever need to manage or remove a large number of clients in order to delete a particular group, WHMCS doesn't currently provide a mass deletion option in the UI.

There are alternative options that may save you time to bulk update. As an example, this action could be performed directly within the database.

Firstly, you would need to identify the ID of the client group that you are wanting to empty. This can be identified by checking within the tblclientgroups table. The entry in the `ID` column is the value we need to retrieve. An easy way to do this would be to identify the `group name` and use the `id` from the same row. 

Finally, using the SQL query below, it is possible to remove all clients from a specific client group using the ID you have just located.  

 

UPDATE `tblclients` SET groupid="0" WHERE groupid="X";

In this scenario, you would simply need to update the “X” with the group ID from tblclientgroups.

Using the above command and updating the “0” to another group ID, you would also be able to move all clients from one group into another. 

Please note: performing queries directly to the database is not something that is typically recommended. This is provided only as an example. We are unable to offer any guarantee this query will work with future versions of WHMCS.  As with any change made to a WHMCS installation, we do recommend ensuring you have a full database backup prior to starting. This backup would allow for a swift resolution should any errors occur. 

tblclientgroups.png

Link to comment
Share on other sites

  • 5 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated