In drupal site maintenance mode all custom menu callback is not working. it redirect into site maintenance page. But user/login is working. I need to create menu like user/login. please help me.

3 Answers 3


If you want to test few menu item when Drupal site is in maintenance mode. You can use Maintenance Exempt module.

From this module's page:

Drupal allows you to set your site into maintenance mode in order to deploy code and database upgrades safely. However, access to the site during maintenance mode is by default controlled by a permission, which is generally only given to administrative users. It's not possible to test the site as a regular anonymous or authenticated user without giving all anonymous/authenticated users the "Use the site in maintenance mode" permission, so you generally have to test those things on the fly after moving the site back to "live" mode.

Until now, that is! This D7+ module (the necessary hook doesn't exist in D6 and below) allows specific people to perform the necessary testing on the site with all role combinations without opening the site up to all of your visitors.


Hi MutantMahesh & TBI Infotech

I got the answer,

The user module implements that hook (user_menu_site_status_alter()) to make sure the site is always online for the user, user/login, user/password and user/reset/* paths. It should be simple enough to use the logic from that function to implement it for your custom path, e.g.

function MYMODULE_menu_site_status_alter(&$menu_site_status, $path) {
  if ($menu_site_status == MENU_SITE_OFFLINE && $path == 'my-path') {
    $menu_site_status = MENU_SITE_ONLINE;

Just let you know..

  • 1
    That is what the "necessary hook" link point in my answer. Commented Aug 1, 2014 at 7:15

Site maintenance is meant to work like this that no operation can be performed on site when it is in maintenance mode . The only user login page is accessible so the user with permission to edit the site can login.

Normally if you log in with admin user, you can access each and every part of the site. With admin credentials you custom callback functions will work too.

But if you are trying to access these pages with anonymous user or user with no permissions to edit content. Then you will automatically get redirected to the maintenance page.

Just try it with admin login.

Hope it will help you.

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.