Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Turn On Maintenance Mode in WordPress

This guide shows you how to show a "back soon" message to visitors while you work on your site.

WordPress2 min read18 steps

What is maintenance mode?

Maintenance mode is like a "closed for cleaning" sign on a shop door. Visitors see a short message instead of a half-finished site. You can still log in and work. It is a good idea when you update, change the design or fix a problem.

WordPress also turns on a short maintenance mode by itself during updates. If it gets stuck, see the last section.

Method 1: Use a plugin

A plugin is a small add-on program for WordPress. This is the easiest way and lets you make a nice page.

  1. Log in to your WordPress dashboard.
  2. Click Plugins, then Add New.
  3. Search for "maintenance mode" or "coming soon".
  4. Pick a plugin with good reviews and many users.
  5. Click Install Now, then Activate.
  6. Open the plugin's settings.
  7. Write a short message, such as "We are updating. Back soon."
  8. Switch maintenance mode On.
  9. Save.

Open your site in a private browser window to check it. You should see the message.

Method 2: Use code

Warning: A mistake in code can break your site. Take a backup first. Use a child theme. A child theme is a safe layer on top of your theme.
  1. Open the functions.php file of your child theme.
  2. Add this code at the bottom.
  3. Save the file.
function hv_maintenance_mode() {
    if (!current_user_can('manage_options')) {
        wp_die('We are updating our site. Please come back soon.', 'Maintenance', array('response' => 503));
    }
}
add_action('get_header', 'hv_maintenance_mode');

This shows the message to everyone except administrators. The code 503 tells search engines the stop is only for a short time.

Turn it off

  1. Switch the plugin to Off, or remove the code.
  2. Open your site in a private window and check that it works.

If WordPress is stuck in maintenance mode

Sometimes an update stops half-way. The site shows "Briefly unavailable for scheduled maintenance". WordPress makes a file named .maintenance in your site folder. Delete it.

  1. Open the File Manager in your hosting control panel.
  2. Open the folder where WordPress lives, often public_html.
  3. Turn on Show Hidden Files, since the name starts with a dot.
  4. Delete the .maintenance file.

Quick recap

  • Maintenance mode shows a "back soon" page to visitors.
  • A plugin is the easiest way.
  • Remember to turn it off when you finish.
  • Delete .maintenance if an update gets stuck.