WP-CLI

A command line interface for WordPress

wp core config - Generate a wp-config.php file.

OPTIONS

--dbname=<dbname>
Set the database name.
--dbuser=<dbuser>
Set the database user.
[--dbpass=<dbpass>]
Set the database user password.
[--dbhost=<dbhost>]
Set the database host. Default: ‘localhost’
[--dbprefix=<dbprefix>]
Set the database table prefix. Default: ‘wp_’
[--dbcharset=<dbcharset>]
Set the database charset. Default: ‘utf8’
[--dbcollate=<dbcollate>]
Set the database collation. Default: ‘’
[--locale=<locale>]
Set the WPLANG constant. Defaults to $wp_local_package variable.
[--extra-php]
If set, the command copies additional PHP code into wp-config.php from STDIN.
[--skip-salts]
If set, keys and salts won’t be generated, but should instead be passed via --extra-php.
[--skip-check]
If set, the database connection is not checked.

EXAMPLES

# Standard wp-config.php file
wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --locale=ro_RO

# Enable WP_DEBUG and WP_DEBUG_LOG
wp core config --dbname=testing --dbuser=wp --dbpass=securepswd --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP