Manage salts for your WordPress installation

Installs: 121

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 5


0.6.1 2017-11-12 22:11 UTC

This package is auto-updated.

Last update: 2021-03-29 00:34:50 UTC


Package license Packagist type Packagist downloads Monthly Downloads Latest Stable Version composer.lock

Manage salts for your WordPress installation

Output salts to STDOUT

wp salts generate # defaults to --format=php
wp salts generate --format=env
wp salts generate --format=yaml

This will grab new salts from the WordPress Salt API and output it to the STDOUT

Output salts to a file

PHP file

wp salts generate --file=/absolute/path/to/file.php

This will output the salts to a file. Because the file contains the complete define() code the salts will be set by a simple require somewhere in your wp-config.php

Environment variable file

wp salts generate --file=/absolute/path/to/.env

This will output the salts as shell environment variables (MY_VAR=VALUE). Useful for projects that load configurations from .env files.

Yaml config file

wp salts generate --file=/absolute/path/to/file.yaml

This will output the salts as Yaml config file.

Other examples

Generally the file format can be desumed from file name / extension. However one can enforce Yaml format when it can't be detected automatically

wp salts generate --format=yaml --my.config

One could also append want to append some custom WordPress salts, such as WP_CACHE_KEY_SALT used by Memcached Object Cache, WP Redis and other plugins:

wp salts generate --format=env --append=WP_CACHE_KEY_SALT,OTHER_USEFUL_SALT

AUTH_KEY='|p/>=h19^l/tFT=_e yOu+_@Zs?VMUObx@@Gx2SD/rPFdb(?jBbpE~w+l-[<ie,o'
LOGGED_IN_KEY='A>r0rY]%#x1CvPqzFN[ (pTRNt1|p[RiFooj<s&w)%<+tI#z/x8Xos%a>_C ]-w>'
AUTH_SALT='hcSd}*.rYZ9g^<1wYGhs_xv<soGS/$} 4*#rsT?Nh!o$elz394!+I5>LPl)AmfLL'
# >>> Note these two additional WordPress salts below
WP_CACHE_KEY_SALT='dzwdcllV*h/@BG/Hh~@tRM_!aV~d.55/o(eoC= E&LBJjG{V1~xl?nN<DJ>jobsp'
OTHER_USEFUL_SALT='hrRt.Ldx&=ywXCCU;5,sOkq ZaAUz7vz3lMp?~,L.EcgpdJ<c_T$4GnAYtKkVhO}'