Skip to content
Related Articles

Related Articles

How to Put Your WordPress Site in Maintenance Mode ?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 12 Aug, 2021

WordPress maintenance mode is an ideal way to cover a website in the development phase. When you update WordPress, it is best to hide tests and errors from visitors.

These changes may include testing the plugin, updating the content, changing the theme, or any other server-side changes. The aim of the article lies in unleashing the way to put the website in maintenance mode. However, the leading WordPress Development Firm could also be a choice for you if you are a beginner or non-tech user. The objective of this mode is to notify the visitors about the website which is in a construction state. It implies that after some time, the website will be back to its initial phase including a few changes.

WordPress Maintenance Mode: WordPress Maintenance mode demands you to carry out the changes in the website without any influence on SEO and user experience. The main benefit of WordPress maintenance mode is that you won’t lose your search engine rankings. When the WordPress website is in maintenance mode, it notifies the search engines of not indexing it.  

 

Why maintenance mode is important?

Each website needs updates and changes. But, there are a few factors that contribute to the website being in maintenance mode.  

  • Every website needs a design and the user interface changes over time.
  • Every website is at risk. WordPress maintenance mode is the most reliable way to solve these errors or bugs.

Typically, you can see changes in real-time on any website. You might be required to post the new content to the website without turning the WordPress maintenance mode ON. In most cases, new content is published very quickly, so there is no need to enable WordPress maintenance mode.

However, if changes are taking longer than usual and bugs can be found in them, you need to use WordPress maintenance mode. Or, the users cannot access the website parts. The other reason for enabling WordPress mode is that it lets you retain the users while the website is in an updating phase. After putting the WordPress website in maintenance mode, it will show the notification on the website and alert them regarding the current situation.

When should you put your website into WordPress Maintenance Mode?

There is no need to put the website in maintenance mode When you’re making adjustments. Like – correcting minor bugs, changing some color schemes, and updating content.  

But as your site gets bigger, the changes can get bigger and take longer. Change in the theme, including unique features and services on the website, results in website downtime. Accordingly, this way, you can restrict the website visitor to use the website.  

 

What are the side effects of using Maintenance Mode for your visitors?

By default, from Maintenance Mode, WordPress creates a splash screen that informs your visitors about maintenance. Besides, it is only a web page with the message that the website is not available on a temporary basis. The splash screen builds an annoying experience for the visitors.  

Your business can make a bad impression on your potential customers. Visitors don’t care what happens behind the scenes. Thus, changing the default WordPress Maintenance Mode page is a good idea. Read on if you want to learn how to do it right.

How to put WordPress into maintenance mode?  

Method 1 – Using WordPress Plugins: This method is for those who want to activate WordPress maintenance mode without touching a single line of code.

All you need to do is download and install the WP Maintenance Mode plugin. After activation, you need to configure the plugin parameters. To do this, go to the right tab and select Settings->Maintenance Mode. On the settings page, you will see 5 tabs: General, Design, Modules, Bot Management and GDPR. Check out the explanation of all below:

  • General: The first tab is the General tab. At the top of the General tab, you will find the status. To activate this plugin and set up your website in WordPress maintenance mode, you must change it to Active. Under the status options, you will find a crawl function for search bots. If you set this option, search engines will have access to your website during the service. Next, there are Backend Role and Frontend Role options, here you can choose which user roles can access your backend while it is in maintenance mode. If you do not select them, then only the administrator will be allowed.
  • Design: In the Design tab, you will create an attractive splash screen. To start creating your splash screen, you can go directly to the Title (HTML Tag) option. In this part, add a title for your splash screen, as well as a title and text. Once you’re done with the post, you can change the background of your service page. As in, the color can be changed or an image could also be used as a background image.
  • Modules: This tab allows you to manage the countdown timer. Set start time and time remaining. Alternatively, you can ask your subscribers to subscribe to receive a notification as soon as your site is active again. The next option under the Modules tab is where you can customize your social networks. All you need to do is post a link to your social media account. The plugin will automatically show the social media button icon on the page.
  • Bot management: The next useful tab is the Manage Bots tab. This tab allows you to add a chatbot to your splash screen. This way, you can maintain interactive communication with your visitors even if you are in maintenance mode. You can even name the bot and add an avatar.
  • GDPR: If you want your visitors to subscribe to the splash page, you need to customize the GDPR tab. GDPR stands for General Data Protection Regulation. Since you are collecting data about your visitors, you need to activate this. Once the preparation is complete, click the Save Settings button and go to your website.

Method 2 – Using a Custom Function: The second method can be a little technical. But don’t worry, it’s not that hard. Remember the default maintenance page that WordPress automatically installs when your website is in WordPress Maintenance Mode. You can put WordPress into maintenance mode manually and customize the page without additional plugins.

All you need to do is add these lines of code to the end of your theme’s functions.php file.

// Activate WordPress Maintenance Mode
function wp_maintenance_mode () {  
  if ( ! current_user_can ( 'edit_themes' ) 
               || ! is_user_logged_in ()) {    
    wp_die ( '<h1> Maintenance </h1> <br /> 
      This site is under scheduled maintenance. 
      Please check back later.'
    ) ;
  }
}

add_action ( 'get_header' , 'wp_maintenance_mode' );

Change the text between the quotes on line 4 to customize the service message.

Method 3 – Using .htaccess File: You can find .htaccess in your website directory. Just rename your current.htaccess file to .htaccess_default, create a new file called .htaccess, and add the following code snippet:

RewriteEngine On
RewriteBase /
RewriteCond% { REQUEST_URI } ! ^ / Maintenance \ .html $
RewriteRule ^ ( . * ) $ Https : 
  //example.com/maintenance.html [R = 307, L]

Now create a maintenance.html file with a maintenance message file in your website directory.

Concluding Remarks: There are many ways to put WordPress into maintenance mode. The first way is to use the WordPress Maintenance Mode plugin. This plugin will help you create a beautiful splash screen. This method is recommended for those unfamiliar with coding. The second method requires adding a piece of PHP code to your functions.php file. The last method you can try is adding code to your .htaccess file.

Keep these methods in mind and implement them when you feel there is a need. Do let us know about your experience with the same.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!