Celebrate WordCamp Europe - 30% OFF! Use coupon WC30 - View Details

Setting License Keys With PHP ConstantsPRO

License keys for WS Form PRO and add-ons can be set using PHP code in wp-config.php.

This feature requires at least version 1.9.139 of WS Form PRO.

Setting the WS Form PRO License Key

You can use the WSF_LICENSE_KEY constant to define the WS Form PRO license key by adding the following code to your wp-config.php file:

define( 'WSF_LICENSE_KEY', '***' );

Where *** is your license key.

This would typically go beneath the WP_DEBUG constant, for example:

define( 'WP_DEBUG', false );
define( 'WSF_LICENSE_KEY', '***' );

Each time a license key is defined in wp-config.php an automatic attempt will be made to activate it next time the WordPress admin is accessed.

When a license key is defined using this method, the settings tab changes as follows for your security:

  • The license key is obscured so that it cannot be edited or seen. Only the last 6 characters are shown for reference.
  • The message describing how to set the license key in wp-config.php is no longer shown.
  • The ability to deactivate a license key is disabled.
  • The ability to active a key is only shown if the attempt to activate the license key has failed.

Setting Add-On License Keys

To obtain the named constant to define for an add-on:

  1. Click on Settings from the WS Form admin menu.
  2. Click on the tab for the add-on.
  3. Under License Key you will see the license key constant, e.g. WSF_ACTION_POST_LICENSE_KEY for the Post Management add-on.

Define the add-on license key by adding the following code to your wp-config.php file:

define( 'WSF_ACTION_POST_LICENSE_KEY', '***' );

Where *** is your license key.

This would typically go beneath the WP_DEBUG constant, for example:

define( 'WP_DEBUG', false );
define( 'WSF_ACTION_POST_LICENSE_KEY', '***' );

Multi-Site

License keys set using this method will apply to all sites in multi-site installations.

Troubleshooting

If you experience issues with this method:

  • Ensure the license key has been entered precisely and correctly for the constant name you have entered.
  • If you have an agency or freelance license key, be sure you have used the WS Form PRO license key and not the bundle/parent key.
  • Try removing the constant, refreshing the settings page, then adding it again to reprocess a license key.