How to put wordpress into maintenance mode without plugin

Do you want to put your wordpress into maintenance mode without plugin?

Here are the small and simple tricks.  The best thing is that you need not have to install bulk plugins for this which will eat your server memory most of the times.

However, there are a lot of free and premium plugins which may be useful.  Especially, plugins includes features that can help you create a simple or more advanced maintenance mode page which simple tricks cant.

When you use WordPress as a publishing tool and platform, I am sure you know that you occasionally need to put your WordPress website into maintenance mode.

This basically help when you re-build your website, change the theme, or test new functionalities or other maintenance of your website. Hence it’s great idea to quickly put your website into maintenance mode and let your visitors and readers know what is going on on your website.

WordPress maintenance mode without plugin

Let us see the most simplest and yet powerful method of doing the same without using any plugin. This simple approach is easiest and quickest way to put your website into maintenance mode for WordPress .  All you need is just to follow TWO steps .

Let’s Start

1. First of all, In the root folder of your WordPress installation,  create a file called .maintenance Note the preceding dot like a .htaccess file.   In Linux version this is considered a hidden file.    Add the below code in this file:

<?php $upgrading = time(); ?>

The above code will basically cause the maintenance page to display until you either remove or rename the the .maintenance file manually.

2. Secondly, create a file maintenance.php in the folder wp-content/ containing the code you want to display the for the maintenance page in wordpress.   Below is a sample code for customized maintenance page.

<?php
$protocol = $_SERVER[“SERVER_PROTOCOL”];
if ( ‘HTTP/1.1’ != $protocol && ‘HTTP/1.0’ != $protocol )
$protocol = ‘HTTP/1.0’;
header( “$protocol 503 Service Unavailable”, true, 503 );
header( ‘Content-Type: text/html; charset=utf-8’ );
?>
<html xmlns=”http://ift.tt/pUEAca;
<body>
<h1>Briefly unavailable for scheduled maintenance of website. Check back in a few minutes.</h1>
</body>
</html>
<?php die(); ?>

Wordpress maintenance mode without plugin pic

TIP: Please rename .maintenance file to anything when ever you want to make your WordPress website go live.

That’s all. You have  done and your WordPress website is ready to be in maintenance mode whenever you want.   Later, modify this maintenance.php file as needed.  You may add some css and some images to make your maintenance mode page more catchy and good looking.  These are the simple and quick tips to activate WordPress maintenance mode without plugin.

Leave a Comment