Add licence key for local instance
Last updated on: June 17, 2026 7:39 am
When deploying the Advanced Post Types Order plugin on local environments (such as localhost, 127.0.0.1, .dev domains, or staging environments like staging.wpengine.com), a licence key is not required by default. This behaviour helps streamline development workflows and avoids unnecessary licence management during testing.

However, if a local or staging database is later migrated to a production environment, the live site may not have a licence key configured. This can create additional steps after deployment and may cause confusion if plugin updates or support features become unavailable.
To ensure that all environments—including local and staging instances—require a valid licence key, add the following constant to your wp-config.php file:
define( 'APTO_REQUIRE_KEY', true );
The wp-config.php file is located in the root directory of your WordPress installation.
Insert the constant above the following section near the end of the file:
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
For example:
define( 'APTO_REQUIRE_KEY', true );
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
Placing the constant before this section ensures it is loaded early enough during WordPress initialization and is recognized by the plugin on every request.