WPML hard code the site key into wp-config Print

  • wpml, wpml site key
  • 3

WPML has a tendency to be a bit flaky with their keys and overnight your WPML site may become unregistered.



This is a pain because, in order to re-register the site again and get access to updates, you have to log in to WPML, find the key, navigate back to WordPress, update the key....its a drag.

However, with the snippet below, adding it to the wp-config.php file, you can override the license key in the database by defining a global variable called: OTGS_INSTALLER_SITE_KEY_WPML

So just add this to your wp-config and you will be set.

################################
// hard code WPML site key in wp-config.php
// https://www.jucra.com/whmcs/knowledgebase/173/
// see: https://wpml.org/faq/install-wpml/#registration-using-php
################################
define( 'OTGS_INSTALLER_SITE_KEY_WPML', 'site_key' );


Another good use for this is if you have a dev server and a production server
, you can define two different license keys for each so when swapping the files between the two servers you don't need to keep updating the key in the database.

;o)


Was this answer helpful?

« Back