WP-CLI

A command line interface for WordPress

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

Quick links: Github issues


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
Success: Generated 'wp-config.php' file.

# 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
Success: Generated 'wp-config.php' file.