Mass update 'contact email' address of all cPanel accounts Print

  • cpanel, whm, centos, rhel, red hat, contact email, api
  • 3

Recently a customer approached us about bulk changing all of their cPanel account's contact email addresses. They wanted to receive all cPanel and AutoSSL notifications to a particular logging email account. The cPanel / WHM panels do not have any bulk update feature inbuilt, though fortunately the WHM API can be used to achieve this task with a little shell sourcery.


  1. Login to your cPanel server via SSH using root, or an account that can attain root priviledges

  2. Quickly create a shell script using nano:
  3. Copy and paste the following code into nano:
    for i in `cut -f2 -d' ' /etc/trueuserdomains|sort`
    /usr/local/cpanel/bin/whmapi1 modifyacct user=${i}
  4. Modify for the address you wish to update
  5. Exit nano:
    CTRL + X then press Y to save changes and hit RETURN
  6. Run  the script:

Was this answer helpful?

« Back