πŸ” Change Two-Factor Authentication (2FA) for an Admin User in WHMCS

If an administrator is locked out of their WHMCS account due to Two-Factor Authentication (2FA) issues (e.g., lost device or app), you can reset 2FA for that user directly via the database.


⚠️ Prerequisites & Warnings

  • Backup First: Always back up your WHMCS database before making changes.
  • Root or MySQL Access: You must have access to the server’s database via phpMyAdmin or the MySQL command line.
  • Version Compatibility: This guide applies to all WHMCS versions using tbladmins for admin authentication.

πŸ› οΈ Step-by-Step Instructions

1. Access Your Database

Via phpMyAdmin (WHM/cPanel/DirectAdmin) or MySQL CLI:

mysql -u root -p

Then select your WHMCS database:

USE whmcs_database_name;

Replace whmcs_database_name with your actual database name.


2. Run SQL Commands to Reset 2FA

Replace 'ADMIN_USERNAME' with the actual admin username.

UPDATE tbladmins SET authmodule = '' WHERE username = 'ADMIN_USERNAME';
UPDATE tbladmins SET authdata = '' WHERE username = 'ADMIN_USERNAME';

3. Log into WHMCS Admin Area

  • Go to your WHMCS Admin Panel.
  • Log in using the affected admin account.
  • Navigate to My Account.
  • Reconfigure Two-Factor Authentication as desired.

βœ… Confirmation

Once logged in successfully:

  • The admin should see the 2FA setup prompt or can manually set it up under My Account β†’ Two-Factor Authentication.

πŸ”„ Optional: Re-enable 2FA Globally (If Needed)

If 2FA was disabled system-wide during recovery, re-enable it via:
WHMCS Admin β†’ Setup β†’ Staff Management β†’ Two-Factor Authentication

Scroll to Top