Today we will check how to put the WordPress website in maintenance mode. As you are searching for this article you might run a website. For each website, there might be a change or update required every time and you might want to show a message about your maintenance activity to your visitors.
If you are not displaying any information about your current maintenance activity there might be chances of confusion for your visitors with unexpected behavior. So its always better to intimate the visitors while doing the maintenance activity. You can achieve this without using any plugin also. For a WordPress website, you can run your website in maintenance mode in a couple of ways. By following these ways you can make your website temporarily unavailable to public access and as an admin you can have all the access even though your website is running under maintenance mode (also, check our WordPress Countdown plugin).
There are several ways to put your WordPress website in maintenance mode, in this article we are listing out the three best ways to run your WordPress website under maintenance mode. But you might need to use some other way based on your technical and infrastructure changes.
Maintenance mode by using the .Htaccess file
The .htaccess file is a very useful file in doing any file system related restrictions. By modifying the .htaccess file you can control the access of files and directories on the server by sending a response code of the server status. Now in this way we are going to use this status code for making the WordPress site in maintenance mode. We are going to set the status code 503 which means the server is temporarily unavailable (also, check this useful post – WordPress default .htaccess file).
In this way we need to create a .html or .php file with the message for notifying your visitors that your website is unavailable due to maintenance activity. Then you need to modify the .htaccess file like below (also, check this nice WordPress YouTube plugin).
In this code snippet we are setting the status code to 503 and also we are redirecting the visitors to the maintenance page which we created. [highlight]RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000[/highlight] here we are setting our IP address from where we are going to access the website.
Maintenance mode by using the WordPress Built-in Maintenance page
Generally when there is any WordPress update to the latest version or update of themes and plugins, then the WordPress will create a dynamic file called .maintenance file. After update is finished the file got deleted automatically. Due to some error if it didn’t delete then your website will be in maintenance mode. For making your website available you need to login to your FTP and need to delete the file from the root directory of your website (also, check this useful post – What is WordPress wp-config.php File).
If you want you can create your own .maintenance file with your custom message for your visitors.
1. Login to your FTP to the WordPress root directory.
2. Create a new file named .maintenance.
—— In text editor, type the custom message you want to display your visitors…
3. Save file.
Once your maintenance is finished then just remove that file from the root directory using FTP.
Maintenance mode by using a WordPress Plugin
There are a lot of WordPress plugins available for making your WordPress website to maintenance mode. But with our earlier experiences, we are preferred to use Coming soon and Maintenance mode plugin by WpDevArt.
This is a nice and powerful plugin that allows you to activate or deactivate the maintenance mode with few clicks. You can also set the maintenance time(how long you want to display the maintenance page). This plugin is fully customizable and if you want you can create any design with this plugin. Below is the screenshot of admin panel, where you can see how to activate the maintenance page.
This plugin has more than 20000 active installations and 4.2 average rating. It has different useful and necessary features. For example, you can add a nice countdown plugin, a simple form for collecting information from users, logo, message and other necessary sections and much more. It is an SEO friendly coming soon plugin, so you can add meta tags for your maintenance page. Also, you can easily exclude pages or Ip’s from maintenance mode. Just try this plugin, we are sure that you will like it (also, you can check our WordPress Pricing table plugin).
Conclusion
We hope you like this tutorial and useful in effectively running your WordPress website. Please consider sharing this valuable information with your friends by using the social share icons.