Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Put Drupal Sites in Maintenance Mode Manually

Parent Feed: 
Put your Drupal Site in Maintenance Mode Manually

Drupal allows to set a website offline with a few clicks via the admin interfacte.

However, we've seen situatuons where the admin interface becomes unavailable, often via a white screen of death.

In this tutorial, I'm going to show you a manual way to force your Drupal 7 site in maintenance mode.

Step #1. Edit the settings.php file

  • Edit the file sites/default/settings.php file, using a FTP client or through cPanel:
Put your Drupal Site in Maintenance Mode Manually
  • At the very end of settings.php, add the code below:
$conf['maintenance_mode'] = 1;

Step #2. End result

Your site will now display the "Site under maintenance" page:

Put your Drupal Site in Maintenance Mode Manually

Step #3. Put your site back online

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

$conf['maintenance_mode'] = 0;

About the author

Valentín creates beautiful designs from amongst the tequila plants of Jalisco, Mexico. You can see Valentín's design work all over this site and you can often find him helping members in our support forum.


Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web