How to put your WordPress site into Maintenance Mode for Public

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

wordpress-Maintenance-Mode

You may need to put your WordPress site into maintenance mode sometimes for regular or crucial updates. If you would not enable the maintenance mode, it will make your website unavailable to public and certainly errors and pop ups will generate, that can bother your readers and certainly prevent them coming to your site. There are several methods for putting your website into maintenance mode which may differ technically; here are the 2 ways to put your site into maintenance mode.

Using .Htaccess:

.Htaccess is the powerful file in linux system that allows you handling much of your website things using it, so if you are using Apache server then you can use the .Htaccess file to control access of directories within the server and can send the response code of the server status.

503 status code can be used to put your website into maintenance mode, that will clearly indicate that your server is temporarily unavailable, before you alter your .htaccess we need to create a new fille in .html or .php format “file extension” and must add a message in the file which might look the following.

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

“Sorry currently we are down for maintenance, we will be back shortly”

In the same way you can style your page as well, next open the .htaccess file in your server and add the following.

  1. <IfModule mod_rewrite.c>
  2. RewriteEngine on
  3. RewriteCond %{REMOTE_ADDR} !^123\.456\.786\.000
  4. RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
  5. RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
  6. RewriteRule .* /maintenance.html [R=503,L]
  7. </IfModule>

This code for .htaccess will change your server status code to 503 and will redirect your website traffic to maintenance page meanwhile you can set your IP address with the following line RewriteCond %{REMOTE_ADDR}!^123\.456\.786\.000 so that you will still be able to access your website.

Maintenance Page Using a Plugin:

There are several plugins available to put your website into maintenance mode, but my favorite out of these is Maintenance mode plugin. Although this plugin hasn’t been updated from couple of years but still it works fine. This plugin allows putting your site into maintenance mode by simple clicks of activation and de activation, along with you can specify the time for how long it will take website to come back to normal state. This plugin is equipped with default theme template to be displayed when you activate the maintenance mode, you can create your own custom page by creating a 503.php file and uploading it to your theme directory. Simply go to the maintenance mode settings page and select the 503.php file you uploaded after creating.

503-page