Maintenance mode makes your WordPress site briefly unavailable to visitors. This can be useful when you’re performing updates, troubleshooting issues, or making major changes to your content or design. But how do you put WordPress in maintenance mode?
Fortunately, it’s easy to create a maintenance mode page with a plugin. This way, you can preserve the user experience (UX) and prevent visitors from seeing broken pages, missing content, or messy pages.
In this post, we’ll discuss when it makes sense to put your WordPress site in maintenance mode. Then, we’ll show you how to do it using a plugin, or by adding code. Let’s jump right in!
When to Use WordPress Maintenance Mode
WordPress maintenance mode is a temporary solution that enables you to display a “website is unavailable” message to visitors. Typically, you’ll use it when carrying out major changes on your site.
For example, you might be redesigning your pages, or experimenting with new plugins. With maintenance mode, you can preserve the user experience (UX) rather than offering incomplete or broken content.
Here are some common scenarios when it makes sense to activate maintenance mode:
- You’re updating your WordPress site. The update process can result in errors if conflicts arise between themes, plugins, or core files.
- You’re making SEO changes. If you’re updating URLs and meta tags, WordPress maintenance mode can help you avoid penalties that might harm your search rankings.
- You’re testing new features. Ideally, you’ll test new features in a staging environment. But when you push updates live, maintenance mode acts as a safety net in case you hit unexpected issues.
- You have maintenance scheduled. Sometimes, websites face downtime due to scheduled maintenance (e.g. for server repairs or upgrades). You can enable maintenance mode to protect your professional reputation.
- You’re troubleshooting issues. When issues arise on your website, you’ll need to identify the cause. WordPress maintenance mode lets you troubleshoot freely without impacting your live site.
- Your WordPress website has been hacked. Following a security breach, maintenance mode lets you recover your content in private while protecting your site visitors.
You might even enable maintenance mode when switching to a different WordPress theme. You could also use it when making substantial content changes. For instance, you might want to edit your navigation menu or remove core web pages, which could result in broken links and structural errors.
How to Enable WordPress Maintenance Mode (In 3 Steps)
Now, let’s take a look at how to use a maintenance mode plugin to enable this feature on your website.
1. Install Website Builder by SeedProd
A plugin is the simplest way to put your WordPress website into maintenance mode. SeedProd is a free tool that lets you design a custom maintenance page. It comes with landing page templates for creating a maintenance page, a 404 page, and a coming soon page.
Go to Plugins > Add New. Then, use the search box to find the plugin and click on Install Now > Activate:
The setup wizard takes just a few minutes to complete. Here, you can choose the free template you’d like to use for your maintenance page.
Alternatively, you can skip the setup wizard and return to the WordPress dashboard.
2. Set Up Your Maintenance Mode Page
If you didn’t configure your maintenance mode page during setup, you can do so now. To get started, navigate to SeedProd > Landing Pages.
Click on Set up a Maintenance Mode Page and choose one of the landing page templates.
If you set up your page when you first installed the plugin, click on the Edit Page button instead:
This will take you to SeedProd’s visual page builder. Here, you can see what your maintenance notice looks like. You can customize the design using the elements to the left of the editor.
With SeedProd, you can build a more engaging maintenance page by adding videos and images:
You can even add a contact form or display a message to tell people when you’ll be back in business.
When you click on a page element, use the Content settings to adjust the text, size, and alignment.
Meanwhile, the Advanced tab lets you change the colors, fonts, padding, visibility settings, and more:
When you’re happy with the design, save your work and hit Publish. Note that this won’t automatically make your maintenance page live.
3. Activate Maintenance Mode
When your maintenance mode page is ready, you’ll need to enable it.
Return to SeedProd > Landing Pages. Then, switch the Maintenance Mode setting to Active:
Note that maintenance mode won’t be visible while you’re logged into WordPress. To view it, you’ll need to open your site in an incognito browser tab or log out of the WordPress admin area.
When you’ve completed all your maintenance tasks, you can use the same toggle switch to deactivate maintenance mode. This will make your live website accessible to customers again.
How to Enable Maintenance Mode Manually
Using a plugin is the easiest way to put WordPress in maintenance mode. However, if you don’t want to install another tool on your website, you can edit your theme’s functions.php file instead.
This is a more complicated process, so you’ll need to be comfortable accessing and editing your site’s files. We also recommend making a fresh backup of your WordPress site before you proceed.
You can locate the functions.php file via File Manager (if your hosting provider offers cPanel access). Or, you can connect to your website files using an FTP client like FileZilla.
Next, you’ll need to identify the root directory for your site, which is usually labeled public_html. Open it and go to wp-content > themes to find the functions.php file.
Now, add the following code snippet to the end of the file:
// Activate WordPress Maintenance Mode
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) { wp_die('<h1>Under Maintenance</h1><br />We’re busy improving our site for you. We’ll be back online shortly. Thanks for bearing with us!');
}
}
add_action('get_header', 'wp_maintenance_mode');
You can customize the maintenance mode message on the fourth line of the snippet. When you’re done, save the file.
If you need to leave your WordPress site in maintenance mode for a longer period, you might want to consider setting up a child theme. This prevents theme updates from overwriting the file and disabling maintenance mode.
Can WordPress Get Stuck in Maintenance Mode?
If you’ve used a plugin, you can disable maintenance mode easily (like we showed you above). If you’ve added code to the functions.php file, you’ll need to delete the code snippet from the file to exit maintenance mode.
However, your site can get stuck in maintenance mode. Typically, this happens when you interrupt the update process by refreshing the page too early. It can also occur due to incorrect file permissions, insufficient server resources, and plugin conflicts.
There are a few troubleshooting steps you can take if this happens. When you enable maintenance mode, your site creates a maintenance file labeled maintenance.html or .maintenance.
This should automatically disappear when you deactivate maintenance mode. If it doesn’t, you’ll need to manually delete the file.
You can locate the file within the root directory of your site. Once again, you’ll need to use an FTP client or File Manager to access the back end and find the file.
If that doesn’t work, you can try deactivating all your plugins and reactivating them one by one to identify incompatibilities. Remember to refresh the page after each plugin you reactivate.
You could also switch to a default WordPress theme to see if it resolves the issue, and clear the browser cache.
Conclusion
Every website will need some work at some point. Perhaps you’re redesigning your pages or testing new plugins. By putting your site into maintenance mode, you can preserve the user experience and maintain a professional image.
To recap, here’s the easiest way to enable WordPress maintenance mode:
- Install a maintenance plugin like SeedProd.
- Set up your maintenance mode page.
- Activate maintenance mode.
Do you have any questions about creating a maintenance mode page for your WordPress website? Let us know in the comments below!
Sophia is a staff writer at WordCandy.co, where she produces quality blog content for WordPress plugin and theme developers, hosting providers, website development and design agencies, and other online businesses.
Leave a Reply