Hey there, fellow business owners! Today, we’re going to talk about something that might not seem glamorous but is oh-so-important: WordPress maintenance mode.
We know. It might not sound like the most exciting topic, but trust us, it’s crucial. Just like how you take your car in for regular maintenance to keep it running smoothly, putting your website into maintenance mode can prevent issues and keep it running smoothly too.
Whether you’re a small business owner just starting out or an experienced marketer, understanding WordPress maintenance mode is a must.
So, grab a cup of tea (or coffee, we don’t really judge), and let’s get started!
What is WordPress maintenance mode?
Maintenance mode, also known as “coming soon” mode, allows website owners to temporarily shut down their website for maintenance or updates without losing any traffic.
When maintenance mode is activated, visitors will simply see a “coming soon” or “under maintenance” message instead of the usual website content.
This feature is useful for a variety of reasons, such as website redesigns, updates, and bug fixes. For example, if you’re working on a redesign of your live website and don’t want visitors to see the work-in-progress, you can activate maintenance mode to hide the site while you do your magic. This will prevent visitors from seeing a broken or incomplete site and also protect any sensitive information during the updates.
Why you might need WordPress maintenance mode
Using maintenance mode has many benefits, including:
Minimise downtime
The main benefit of WordPress maintenance mode is preventing website downtime. Basically, if a search engine, like Google, checks your website while you’re updating or redesigning it and it lands on a broken or 404 page, it will be marked as down. If maintenance mode is activated, on the other hand, it will simply be noted as temporarily unavailable, thus keeping the recorded downtime at bay.
Minimising downtime is essential for both users (who love to be kept in the loop as to why their favourite blogs are down) and search engines (since websites that are down frequently don’t perform well SEO-wise).
Keep visitors updated
Additionally, maintenance mode allows you to keep your visitors informed about what is happening with your website. A well-designed “coming soon” page can be used to give visitors an estimate of when the website will be back online. Most plugins even include a contact or subscription form to let users know when the website is ready for business again.
Not using maintenance mode when maintaining your website is like a local market closing down for repairs without displaying a notice stating the reason and the time they’re going to be back to business.
Think about it, what would your visitors think if they opened your website and a broken page showed up just because you were trying a new plugin or redesigning your website? Wouldn’t you rather have them land on a beautifully-designed page that lets them know you’ll be back soon?
Schedule updates
Another benefit of using a maintenance mode plugin is that it allows you to schedule updates for a specific time. This means that you can choose to perform any maintenance tasks during non-peak hours when there is less traffic on your website and schedule the maintenance mode to be activated during that time. That will minimise the effect of performing important edits on both downtime and user experience.
How to set WordPress maintenance mode
There are different methods and plugins that allow you to set up and activate maintenance mode on a WordPress website.
WordPress maintenance mode using a maintenance plugin
One of the most convenient features of WordPress is the ability to use plugins to achieve different goals, including setting up maintenance mode.
Some of the most popular options include “Maintenance” (along with its Pro version) and “WP Maintenance”. These plugins usually offer a variety of customisation options, such as the ability to add a background image or countdown timer to your “coming soon” page.
Here’s how to set WordPress maintenance mode using a plugin:
- Install and activate one of the aforementioned plugins on your WordPress website
- Head to the plugin’s settings page and configure the options to your liking. You can play around with different features if you’ve never used such a plugin before. For example, “WP Maintenance Mode” even has options to add a chatbot or a GDPR disclaimer. Worry not; you’ll get the hang of it quickly
- Customise the “coming soon” page by adding a background image, countdown timer, or a subscribe form if you want to keep your visitors informed. Keep in mind that extra features are usually paid
- Activate maintenance mode by clicking on the appropriate button in the plugin’s settings
- When the updates are completed, remember to deactivate maintenance mode if you haven’t set a schedule for the process
WordPress maintenance mode by adding a code snippet to the .htaccess file
If you have some coding skills and aren’t fond of WordPress plugins, you can use a code snippet to activate maintenance mode on your website. This method involves adding a specific code to your website’s .htaccess file.
Keep in mind that this is a more advanced method and should be used with caution. If you’ve never played around with code before, we highly recommend sticking with a WordPress plugin instead.
To activate WordPress maintenance mode using this method, add the following code snippet to your website’s .htaccess file (you can find it by following this guide from HubSpot):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
PS: Replace the text “maintenance.php” with the name of your maintenance page
Save the changes to your .htaccess file.
When the maintenance or updates are completed, remove the code snippet from the .htaccess file and save the changes.
WordPress maintenance mode by adding a code snippet to the functions.php file
You can also activate maintenance mode in WordPress using code by adding a simple code snippet to your theme’s functions.php file. To do so, follow these steps:
- Log in to your WordPress dashboard
- Head to Tools > Theme File Editor
- On the right-hand side, select the functions.php file from the list of theme files (may be displayed as “Theme Files”).
- Copy the following code and add it to the bottom of the file:
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('Maintenance, please come back soon.');
}
}
add_action('get_header', 'wp_maintenance_mode');
Click the Update File button to save the changes.
This code will display a “Maintenance, please come back soon.” message to all visitors who are not logged in as an administrator. You can change the message you want to display by editing it within the code.
If you want to show a custom page instead, you can create a new file named “maintenance.php” in your theme folder and add your custom HTML/PHP code. Then, you can change the wp_die() function to include the following line of code instead:
include_once(dirname(__FILE__) . '/maintenance.php');
As always, you can turn off the maintenance mode by removing the code snippet from the functions.php file.
WordPress maintenance mode using a server-level configuration
Some web hosts allow you to enable maintenance mode at the server level. This is a good option if you’re not comfortable with code and don’t want to use a plugin.
Here’s how to activate WordPress maintenance mode using this method:
- Contact your web host’s support team and enquire about enabling maintenance mode at the server level
- Follow the instructions provided by your web hosting provider. For example, SiteGround allows you to do this by password-protecting your website
- Customise the “coming soon” page by adding a background image, countdown timer, or a subscribe form if desired (and if the web host offers that option)
- When the maintenance or updates are completed, contact your web host again to disable maintenance mode (or follow any deactivation steps they provided initially)
It’s essential to note that this method might vary depending on the web host you are using and the level of control you have over your server.
Remember to test things out
No matter which method you follow, it’s important to test your website after activating the maintenance mode and before taking it out to make sure everything is working as expected. To do so, simply use incognito mode or a different browser or device to visit your website.
Conclusion
And there you have it! A comprehensive guide to WordPress maintenance mode. Remember, understanding and using maintenance mode on your WordPress website is key to keeping it up and running and minimising disruptions. So, don’t hesitate to use maintenance mode next time you need to perform updates or maintenance on your website. Happy website building!
Need help with website maintenance?
Managing and maintaining a WordPress website is no small feat, especially if you have a business to run. Worry not, though, as we’re here to help. Just drop us a message, and we’ll show you how we can take all of this hassle off your plate.
0 Comments