wp-config.php Constants

Constants you can add to wp-config.php to control Elephanta: encryption key, PHP snippet safe mode, disabling security for recovery and forcing the free version.

Developer 1 min read Updated
On this page

Add these lines to wp-config.php above the line /* That's all, stop editing! */.

Constant Effect
ELEPHANTA_ENCRYPTION_KEY A fixed key for encrypting stored secrets, so changing WordPress salts doesn't make them unreadable
ELEPHANTA_CODE_SAFE_MODE Skips all PHP code snippets (recovery after a broken snippet)
ELEPHANTA_SECURITY_DISABLE Switches off the Security module (recovery after a lockout or forgotten login URL)
ELEPHANTA_FORCE_FREE Shows the free version on a licensed site (testing)
DISALLOW_FILE_EDIT WordPress constant; also disables Elephanta PHP snippets

#Encryption key

define( 'ELEPHANTA_ENCRYPTION_KEY', 'a-long-random-string-of-at-least-32-characters' );

Add it before saving API keys, SMTP passwords or activating the licence. If you add it later, re-enter your secrets.

#Recover from a broken PHP snippet

define( 'ELEPHANTA_CODE_SAFE_MODE', true );

Log in, fix or deactivate the snippet in Elephanta → Custom Code, then remove the line.

#Recover from a security lockout

define( 'ELEPHANTA_SECURITY_DISABLE', true );

Log in at /wp-login.php, review Elephanta → Security (for example the hidden login address or blocked IPs), then remove the line.

#Test the free version

define( 'ELEPHANTA_FORCE_FREE', true );
Remove recovery constants afterwards

ELEPHANTA_SECURITY_DISABLE and ELEPHANTA_CODE_SAFE_MODE are for recovery only. Remove them once you've fixed the problem so your protection and snippets work again.