wp config set <name> <value>

Sets the value of a specific constant or variable defined in wp-config.php file

Arguments

NameDescription
nameName of the wp-config.php constant or variable
valueValue to set the wp-config.php constant or variable to

Options

NameDescription
--addAdd the value if it doesn’t exist yet. This is the default behavior, override with –no-add
--no-addAdd the value if it doesn’t exist yet. This is the default behavior, override with –no-add
--rawPlace the value into the wp-config.php file as is, instead of as a quoted string
--anchor <anchor>Anchor string where additions of new values are anchored around. Defaults to “/* That’s all, stop editing!”
--placement <options>Where to place the new values in relation to the anchor string
--separator <separator>Separator string to put between an added value and its anchor string. The following escape sequences will be recognized and properly interpreted: ‘ ’ => newline, ‘ ’ => carriage return, ‘ ’ => tab. Defaults to a single EOL (“ ” on *nix and “ ” on Windows)
--type <options>Type of the config value to set. Defaults to ‘all’