Is there a module (or other way) to give permission to non-admin-users to put the site offline (and only that permission)?

  • Which version of Drupal are you using? Commented Sep 1, 2014 at 14:42
  • It's under '/admin' so they'd need the "access administration pages" permission straight off I think
    – Clive
    Commented Sep 1, 2014 at 14:43
  • You can the site status programmatically To put the site offline For D7 variable_set("maintenance_mode",1); To put the site online For D7 variable_set("maintenance_mode",1); For D6 it is variable_set('site_offline', '0'); Commented Sep 1, 2014 at 15:01

5 Answers 5


There is a module for that!

Maintenance Mode Permissions

Placing a site in or removing it from maintenance mode is allowed under a permission that has wide spread administrative access (administer site configuration). Sometimes you'd like to give permission to put the site in maintenance mode to someone but not give them complete access. This modules enables this case.


On D6 and D7, there's no specific permission to give to a role to grant access to the Maintenance mode page (admin/config/development/maintenance). This is because it has the "Administer site configuration" that grants access to many other configs that important and should be restricted only to a few users/role.

You can use Drush to do it:

drush vset maintenance_mode 1

Or create a new permission for that path (admin/config/development/maintenance) with hook_alter_menu:

function {your module}_alter_menu(&$items) {
  // Site maintenance
  $items['admin/settings/site-maintenance']['access arguments'] = array('administer maintenance mode');

To create the new permission use hook_permission:

function {your module}_permission() {
  return array(
    'administer maintenance mode' => array(
      'title' => t('Administer maintenance mode'),
      'description' => t('Perform administration on maintenance mode page.'),

At the very end of sites/default/settings.php, add the code below:

$conf['maintenance_mode'] = 1;

Remove the line of code above, or change the value to 0 to put your site online again:

$conf['maintenance_mode'] = 0;

Thats all


For Drupal 7/8/9 you can use the module Custom Permissions for that.

You have to (Drupal ^8):

  1. Install the module Custom Permissions
  2. Go to settings page /admin/people/custom-permissions/list
  3. Set the "Custom Permission" for Route "system.site_maintenance_mode"
  4. Find and set your permission on /admin/people/permissions

That's it.

(If you have installed Devel, you can find a list of routes on the page /devel/routes)


You would need to give the permission "System > Administer site configuration". You can give that permission basically to whatever role you like. This lets users with that role put your site into Maintenance Mode. But be aware that this is a very powerful permission and it comes along with other administrative rights. Also – if you give that permission to a role you should probably also give the permission to view the site, if it's in Maintenance Mode.

I would consider such practice actually a security risk and would recommend to only give that permission to an extra role like "co-admin" or the like.

Edit: there's a module that let's you split administrative permissions into smaller chunks called Custom Permissions. The project page also gives a good impression which administrative rights are connected to the permision "System > Administer site configuration".

"By default the following permissions are created:"

administer administration theme
administer clean-urls
administer date-time
administer error reporting
administer file system
administer modules
administer performance
administer site information
administer site maintenance
display site building menu
display site configuration menu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.