Activate License via wp-config.php
Learn how to activate WSMS licenses directly from wp-config.php for easier multi-site management.
WSMS allows you to activate licenses directly through the wp-config.php file. This approach simplifies license management across multiple sites or WordPress installations.
Why Use This Method?
- Multi-site management: Streamlines license activation across WordPress multisite networks
- Automation-friendly: Perfect for automated deployments and staging environments
- Reduced overhead: Eliminates manual entry for each add-on installation
Implementation Steps
Step 1: Access wp-config.php
Open your WordPress configuration file (wp-config.php) for editing. This file is located in the root directory of your WordPress installation.
Locate a suitable position near the end of the file, above this line:
/* That's all, stop editing! Happy publishing. */
Step 2: Define Your License Keys
Add the WP_SMS_LICENSE constant with your license key(s). There are three formats you can use:
Single License
For a single add-on license:
define('WP_SMS_LICENSE', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
Multiple Licenses (Array Format)
For multiple add-on licenses using PHP array syntax:
define('WP_SMS_LICENSE', [
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
]);
Multiple Licenses (Comma-Separated)
For multiple add-on licenses using a comma-separated string:
define('WP_SMS_LICENSE', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
Step 3: Save and Verify
- Save your changes to
wp-config.php - Log in to your WordPress admin panel
- Navigate to SMS → Add-Ons
- Confirm that your licenses are now activated
Important Notes
- Replace
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwith your actual license keys - Each license key should be on a separate line when using array format for better readability
- This method works for all WSMS add-ons including Pro, Two-Factor, WooCommerce, and more
Last updated: December 23, 2024