Activating maintenance mode in WordPress is a critical step during site migrations to mybox, theme redesigns, or major plugin updates. It ensures that visitors see a professional notice instead of a broken site, and it prevents search engines from indexing temporary errors.
Table of Contents
Why Use Maintenance Mode?
- Preventing Data Loss: During a migration to mybox, maintenance mode prevents users from leaving comments or making purchases that might not be synced to the new server.
- SEO Protection: Correct maintenance tools send a 503 Service Unavailable header, telling Google that the downtime is temporary and your rankings should be preserved.
- Professionalism: It allows you to test changes on your mybox-hosted site while showing the public a branded “Coming Soon” or “Under Construction” page.
Method 1: Using a Plugin (Recommended for Customization)
For most users, plugins offer the easiest way to create a high-quality maintenance page without touching code.
- Install a Plugin: Go to Plugins > Add New in your WordPress dashboard. Search for “Lightstart” (formerly WP Maintenance Mode) or “SeedProd”.
- Activate & Configure: Once activated, navigate to the plugin settings. Most allow you to:
- Set a custom headline and description.
- Add a countdown timer for when you’ll be back online.
- Include social media links or a newsletter signup form.
- Whitelisting Admins: Ensure the settings allow “Logged-in Administrators” to bypass the maintenance screen so you can still see the live site.
- Go Live: Toggle the status to “Activated” and save.
Method 2: Built-in WordPress “Update” Mode
WordPress automatically creates a maintenance gate during core or plugin updates. You can trigger this manually using a simple file.
- Access Your Files: Connect to your FTP account via an FTP client such as FileZilla.
- Create the File: In your site’s root directory (usually
public_html), create a new empty file named exactly.maintenance. - Add the Code: Open the file and paste this small snippet:
<?php $upgrading = time(); ?> - Result: Your site will now display the default message: “Briefly unavailable for scheduled maintenance. Check back in a minute.”
- To Disable: Simply delete the
.maintenancefile once your work is complete.
Method 3: Using the functions.php File (No Plugin Needed)
If you prefer not to install extra plugins and want a lightweight solution, you can add a snippet to your theme.
- Navigate to Appearance > Theme File Editor.
- Select the functions.php file on the right side.
- Paste the following code at the very bottom:
PHP
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Under Maintenance</h1><br />We are making things even better. We will be back shortly!');
}
}
add_action('get_header', 'wp_maintenance_mode');
- Save the file. This will block everyone except logged-in admins from viewing the site.
Troubleshooting: “Stuck in Maintenance Mode”
Occasionally, after an update, WordPress might fail to delete the temporary .maintenance file, leaving your site stuck.
- The Fix: Log in to your FTP account, find the
.maintenancefile in the root folder, and delete it manually. Your site will return to normal immediately.
Summary
Whether you choose a feature-rich plugin like SeedProd or a quick manual file edit, maintenance mode is a “safety net” for your digital presence. When moving to mybox, using this mode ensures that your transition is seamless and your SEO remains intact. Once you’ve verified your changes, remember to clear your site and server cache in the mybox panel to ensure the maintenance screen disappears for all visitors.