drush variable-set

Set a variable.

Drush Command

drush variable-set

Arguments

name : The name of a variable or the first few letters of its name.
value : The value to assign to the variable. Use '-' to read the object from STDIN.

Aliases

drush vset

Options

--yes : Skip confirmation if only one variable name matches.
--always-set : [object Object]
--exact : The exact name of the variable to set has been provided; do not prompt for similarly-named variables.
--format : [object Object]

Examples

Set the preprocesscss variable to true. Skip confirmation if variable already exists.

drush vset --yes preprocesscss TRUE
Take the site offline; skips confirmation even if maintenancemode variable does not exist. Variable is rewritten to siteoffline for Drupal 6.
drush vset --exact maintenancemode 1
Choose from a list of variables beginning with "pr" to set to (bool)true.
drush vset pr TRUE
Set a variable to a complex value (e.g. array)
php -r "print jsonencode(array('drupal', 'simpletest'));"  | drush vset --format=json projectdependencyexcluded_dependencies -