The WordPress maintenance mode page automatically shows to website visitors when youโre updating your site, like when youโre updating core files, plugins or themes. The point of the maintenance mode page is to prevent your site from looking like itโs broken when itโs just undergoing routine updating.
The page is supposed to show only temporarily, but sometimes it sticks around for longer than it should. That means your site will be offline for far longer than you intended, which can be bad for everything from your brand reputation to search engine ranking.
Another problem that a lot of website owners have with WordPress maintenance mode is that the page is overly basic. It has limited messaging, which doesnโt exactly clue your visitors into whatโs going on and how long the site will be down for. If branding is a concern, thereโs a way to rectify this.
In this article, weโre going to cover the ins and outs of the WordPress maintenance mode. Weโll explain why and how it happens, common problems users face with it and options for creating a more stylized maintenance page.
Note: Before you perform any type of maintenance or work on your site, itโs smart to back it up. Here are the best WordPress backup plugins that we recommend.
What is WordPress Maintenance Mode?
This feature is built into the WordPress core, and it got its start with version 3.0. When you update a plugin, theme or installation, the maintenance mode page and messaging is shown to visitors. The message says, โBriefly unavailable for scheduled maintenance. Check back in a minute.โ And thatโs all there is to the page. As you can see in the screenshot below, nothing else is there โ itโs just a blank page otherwise.
When your siteโs in maintenance mode, WordPress also returns a 503 HTTP (which means โservice unavailableโ) status code, which tells the search engine (Google, most likely) that youโre working on the page or that something went wrong with your website and to check back in a bit. This code is good for your SEO, because it tells Google that your siteโs only down temporarily, so it wonโt harm your ranking.
P.S. While your site wonโt be viewable by visitors, it can still be accessed by administrators. You can log in and edit your site as usual.
What Makes Maintenance Mode Appear?
When your WordPress website is being updated or something is being installed, other backend processes are temporarily stopped. Usually, this pause only lasts a few seconds (the exact duration depends on how many updates there are and their sizes). WordPress uses the wp_maintenance() function, creating a temporary .maintenance file for your website. That file contains the maintenance mode message. Once your website updates are finished, the file is auto-deleted, and your website goes back to normalโฆassuming all is working correctly.
Getting Stuck in Maintenance Mode
Itโs not uncommon for a website to get stuck in maintenance mode. Itโs also possible that youโll have trouble logging into your site if itโs stuck in maintenance mode โ so neither you nor your visitors will be able to access your site in the back or front end.
WordPress maintenance mode tends to get stuck if thereโs some type of conflict and the .maintenance file thinks updates are still occurring even if theyโve really been completed. This can happen if you try to leave or refresh the updates screen while an update is still working.
Itโs also possible that you have a plugin or theme thatโs not compatible with your WordPress version โ something that can be made obvious when you try to run an update. An outdated version of WordPress or an outdated plugin or theme could end up having compatibility issues. The lesson? Keep everything as up to date as possible.
How to Get Your Website Out of Maintenance Mode
The good news is that itโs not too difficult to get your site out of maintenance mode if itโs stuck there. Before you access your siteโs files, though, empty the browser cache. Itโs possible that your website is out of maintenance mode, but your browser is still serving you a cached version of the page. Emptying the cache could clear that up.
Each browser has its own method for clearing the cache, but theyโre all straightforward. For example, in Safari, you just click Develop > Empty Caches at the top.
Didnโt work? No problem. Basically, all you have to do is manually delete the .maintenance file. Hereโs how:
- Log in to your websiteโs file manager through SFTP or your hosting provider. (Get in touch with your host to find out exactly how to access the root directory if youโre unsure.)
- Navigate to your websiteโs root folder. In our case, it was named after the siteโs domain name. You know youโre in the right folder if the wp-config.php file is in there.
- Find the .maintenance file and delete it.
Now, clear the browser cache and refresh your website โ it should be back to normal.
How to Avoid Getting Stuck in Maintenance Mode
There are a few best practices to follow to avoid getting hung up in WordPress maintenance mode. The biggest tip is to not do anything else to your site during an update. Donโt refresh or navigate away from the screen until your update or installation is finished. Here are more strategies to follow:
Stagger Plugin Updates
Avoid clicking Update Now on multiple plugins in quick succession. While WordPress tries to stagger the updates even if you try to do it all at once, even a brief delay could cause a conflict.
To update multiple plugins in one shot the right way, do the following:
- Click Updates Available at the top of the Plugins page.
- Select the checkbox above the top plugin. This will select all of them.
- Choose Update from the dropdown menu.
- Click Apply.
This way, WordPress will update them in order, helping you to avoid a conflict.
Note: Some users may still have trouble with bulk-updating, even if they follow the steps above. If you continue running into problems, manually update your plugins and themes one by one. Let each one complete before going on to the next.
Regularly Update Your WordPress Plugins
Try to update each plugin as itโs patched or improved by the developer and an update for it is ready. If you wait several weeks and then try to update all of your plugins at one time, youโre more likely to face a conflict. Set an โupdate dayโ every week to stay on top of it.
If you must update several plugins at once, say 30 or more, do them manually one by one. Test your site in between, clearing the cache and logging out, then logging back in, making sure nothing broke your site. If something goes wrong that you canโt fix, use a backup and then replace the plugin thatโs causing the problem.
You can also set plugins to automatically update. In the screenshot below, the first plugin is already set to auto-update, while the second one still has the option that can be enabled.
Alternatively, you can use a plugin like Easy Updates Manager to keep your plugins, site and themes up to date. After installing and activating this plugin, go to Dashboard > Updates Options to see a variety of settings for keeping everything across your WordPress site updated.
How to Customize Maintenance Mode
There are all different ways you can customize and extend WordPress maintenance mode. This can give you the ability to manually enable it, add your own branding to the page or personalize the message that visitors will see.
Adding Your Own .Maintenance File
While the default WordPress maintenance mode page canโt be changed, you can create your own .maintenance file that will show in its place. All you have to do is create the page โ WordPress knows to automatically check for it.
- In your file manager, go into the wp-content folder.
- Create a new file.
- Name the file maintenance.php.
- Add your custom message and CSS (optional).
I simply changed the wording of my page, and as soon as I updated one of my themes, my new WordPress maintenance mode page showed automatically. A few seconds later, when the theme was finished updating, it went back to normal.
Using a Plugin to Create a Custom Maintenance Page
If you arenโt interested in writing CSS code or you need to design a richer page than your coding skills allow, a plugin is the next best option. Here are two suggested plugins, one feature-rich and the other basic.
Coming Soon Page, Maintenance Mode and Landing Pages
The Coming Soon Page, Maintenance Mode and Landing Pages plugin has more than a million active installations and five stars from over 4,300 reviews. There are a number of customizable maintenance page templates to choose from, along with โComing Soonโ and other WordPress page templates. You can create your own from scratch, too.
Whatโs nice about this plugin (and many others) is that you activate WordPress maintenance mode manually. As long as youโve told SeedProd what to use as your maintenance mode page, thatโs what will show when you manually activate it.
Unfortunately, it doesnโt seem to automatically show this page when you do something like update your plugins or themes โ visitors will still see the default WordPress maintenance mode message. However, you can manually activate your custom page before making those type of updates to keep it on-brand.
WP Maintenance Mode
While it doesnโt have anywhere near as many reviews as SeedProdโs plugin above, WP Maintenance Mode stands strong at more than 800,000 active installations and 4.5 stars. This oneโs pretty basic, but if you want something different than WordPressโ default without having too many bells and whistles, itโs a reliable option. Customize your message, add a few design tweaks and manually enable your new maintenance mode page to show when youโre working on your site.
Using Divi Layouts
Out of the box, Divi doesnโt have a built-in way to enable/disable maintenance mode, but we do have a selection of maintenance mode pages that you can customize. Then, as long as youโre using a maintenance mode plugin that lets you upload a customized page, youโre good to go. Divi Switch, for example, is a toolkit of over 50 Divi add-ons, including the ability to activate maintenance mode.
How to Manually Enable Maintenance Mode
There are two ways to manually enable WordPress maintenance mode. The first is using a plugin, and the second is adding code to your functions.php file. Weโll go over both methods here. (While we already touched on plugins that let you manually enable the maintenance page, thereโs a super-slim option you may want if you donโt care about design elements.)
First, here are the times when you may want to put your site into maintenance mode:
- Developing the site pre-launch.
- Designing structural elements, like the navigation menu.
- Editing site code. (Itโs always best to use a staging site, by the way!)
- Editing site content.
- Fixing a bug.
- Launching a product, service or site redesign.
- Updating core WordPress, plugins or themes.
- Uploading a new version of a plugin or theme.
Using the Slim Maintenance Mode Plugin
There arenโt any design settings โ or settings of any kind โ with the Slim Maintenance Mode plugin. Thereโs just the option to manually turn maintenance mode on and off as you need to. Activating the plugin will show a maintenance page to visitors, like in the screenshot below. To take your site out of maintenance mode, simply deactivate the plugin.
Adding Code to the Functions.php File
If you really donโt want to deal with yet another plugin, you can force your website into maintenance mode by adding a special code to the functions.php file.
- Find functions.php in your file manager by going to wp-content > themes and then the folder for your active theme. The file should be in there.
- On line 2, right under the php header, add the following code:
- Replace Website Under Maintenance and We are performing scheduled maintenance. We will be back online shortly! with whatever wording you want.
- Click Save.
- If you visit your website when youโre logged out, youโll see this:
To take your site out of maintenance mode, just delete that code and click Save again.
Final Thoughts About WordPress Maintenance Mode
The WordPress maintenance mode that comes standard is a great feature, automatically and temporarily making your site unavailable to visitors as it updates. But there are a lot of times when you may want to brand your maintenance page or activate it manually. Thatโs where knowing how to adapt your websiteโs files or which plugins to choose come in handy.
Also, if your site happens to get stuck in maintenance mode, you now know how to get it out so that your traffic and page rank arenโt impacted. Plus, youโre now well-versed in how to update your site without raising the risk of it sticking in maintenance mode indefinitely.
Do you have a maintenance mode strategy or plugin we didnโt cover? Tell us about it in the comments!
Leave A Reply