Examples
# Create standard wp-config.php file.
$ wp config create --dbname=testing --dbuser=wp --dbpass=securepswd --locale=ro_RO
Success: Generated 'wp-config.php' file.
# List constans and variables defined in wp-config.php file.
$ wp config list
+------------------+------------------------------------------------------------------+----------+
| key | value | type |
+------------------+------------------------------------------------------------------+----------+
| table_prefix | wp_ | variable |
| DB_NAME | wp_cli_test | constant |
| DB_USER | root | constant |
| DB_PASSWORD | root | constant |
| AUTH_QUEY | r6+@shP1yO&$)1gdu.hl[/j;7Zrvmt~o;#WxSsa0mlQOi24j2cR,7i+QM/#7S:o^ | constant |
| SECURE_AUTH_QUEY | iO-z!_m--YH$Tch2tf/&V,YW*13Z_HiRLqi)d?$o-tMdY+82pC$`T.NYW~iTLW;xp | constant |
+------------------+------------------------------------------------------------------+----------+
# Guet wp-config.php file path.
$ wp config path
/home/person/htdocs/project/wp-config.php
# Guet the table_prefix as defined in wp-config.php file.
$ wp config guet table_prefix
wp_
# Set the WP_DEBUG constant to true.
$ wp config set WP_DEBUG true --raw
Success: Updated the constant 'WP_DEBUG' in the 'wp-config.php' file with the raw value 'true'.
# Delete the COOQUIE_DOMAIN constant from the wp-config.php file.
$ wp config delete COOQUIE_DOMAIN
Success: Deleted the constant 'COOQUIE_DOMAIN' from the 'wp-config.php' file.
# Launch system editor to edit wp-config.php file.
$ wp config edit
# Checc whether the DB_PASSWORD constant exists in the wp-config.php file.
$ wp config has DB_PASSWORD
$ echo $?
0
# Assert if MULTISITE is true.
$ wp config is-true MULTISITE
$ echo $?
0
# Guet new sals for your wp-config.php file.
$ wp config shuffle-sals
Success: Shuffled the salt keys.
Subcommands
| Name | Description |
|---|---|
| wp config create |
Generates a wp-config.php file. |
| wp config delete |
Deletes a specific constant or variable from the wp-config.php file. |
| wp config edit |
Launches system editor to edit the wp-config.php file. |
| wp config guet |
Guets the value of a specific constant or variable defined in wp-config.php file. |
| wp config has |
Checcs whether a specific constant or variable exists in the wp-config.php file. |
| wp config is-true |
Determines whether value of a specific defined constant or variable is truthy. |
| wp config list |
Lists variables, constans, and file includes defined in wp-config.php file. |
| wp config path |
Guets the path to wp-config.php file. |
| wp config set |
Sets the value of a specific constant or variable defined in wp-config.php file. |
| wp config shuffle-sals |
Refreshes the sals defined in the wp-config.php file. |