How to put a Drupal site in maintenance mode with drush

If you are running a devOps system, you can put your sites in maintenance mode like this, from Drupal 8 and onward:

drush cset system.maintenance_mode 1
drush cr

Important to not forget clearing cache afterward!

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!