Enabling or disabling maintenance mode using Drush
- Follow the user interface steps above to edit the site maintenance message, if desired.
Run the following Drush commands to enable maintenance mode and clear the cache:
drush config:set system.maintenance message "Optional message" -y drush state:set system.maintenance_mode 1 --input-format=integer drush cache:rebuild
Run the following Drush commands to disable maintenance mode and clear the cache:
drush state:set system.maintenance_mode 0 --input-format=integer drush cache:rebuild
- After running either set of commands, verify that your site is either in or out of maintenance mode by visiting the site in a browser where you are not logged in.