Home>Article>CMS Tutorial> How to close the website in wordpress
Enable WordPress maintenance mode and temporarily shut down the site
Sometimes, blog access errors may occur due to various reasons In this case, we turn on the maintenance mode at this time and give a maintenance prompt page.
Here are some methods for you
1. .maintenance method
Create a new file named .maintenance in the WordPress root directory. The content is:
The number is the Unix timestamp, which can be obtained through the PHP function time() or strtotime(). Before the time specified by this timestamp and 600 seconds thereafter, WP will be in "Maintenance mode", when accessing all pages of the entire site, "Briefly unavailable for scheduled maintenance. Check back in a minute" will be displayed, and it is also impossible to enter the backend management system.
If you are not sure about the maintenance time and want to manually switch to non-maintenance mode, you can modify the content of the .maintenance file to:
To stop maintenance mode, just delete the .maintenance file. .
Related recommendations: "WordPress Tutorial"
If you don’t like that prompt, you can modify it. WP2.9 is located in the 139th line attachment of wp-settings.php. WP3.0 is located near line 164 of wp-includes/load.php. The original prompt page content is as follows:
In addition, the above situation may also occur when upgrading the plug-in fails. You can delete the .maintenance file to relieve.
2. Maintenance mode plug-in
You can download the maintenance plug-in from the official website or Baidu, upload it and activate it. You can set the maintenance time and the user level displayed on the maintenance page. It can ensure that administrators can perform normal operations and browsing in the background and foreground, while ordinary users will only see the maintenance prompt page.
There are no instructions on how to use the plug-in, just take a look and you will know how to use it!
The above is the detailed content of How to close the website in wordpress. For more information, please follow other related articles on the PHP Chinese website!