Sometimes, due to various reasons, our website may have access errors. At this time, we need to temporarily close the site for maintenance. So how can we temporarily close the site for maintenance? Now let’s take a look at how to temporarily close our site.
1. . maintenance method
Create a new file named. Maintenance in the root directory of WordPress. The contents are as follows:
<?php $upgrading = 1234567890; ?>
The number is UNIX time stamp, which can be obtained by PHP function time() or strtotime(). At the time specified by this time stamp and before 600 seconds after it, WP will be in “maintenance mode”, and “briefly unavailable for scheduled maintenance. Check back in a minute” will be displayed on all pages of the whole station, and it is also unable to enter the background management system.
If you are not sure about the maintenance time and want to switch to non maintenance mode manually, you can modify the. Maintenance file as follows:
<?php $upgrading = time(); ?>
To stop maintenance mode, just delete the. Maintenance file.
If you don’t like the hint, you can modify it. Wp2.9 is located in WP– settings.php 139 rows of attachments, wp3.0 in WP includes/ load.php Near line 164, the content of the original prompt page is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo /*WP_I18N_MAINTENANCE*/'Maintenance'/*/WP_I18N_MAINTENANCE*/; ?></title></head> <body> <h1><?php echo /*WP_I18N_MAINT_MSG*/'Briefly unavailable for scheduled maintenance. Check back in a minute.'/*/WP_I18N_MAINT_MSG*/; ?> </h1> </body>
In addition, the above situation may also occur when the plugin upgrade fails, which can be removed by deleting the. Maintenance file.
The maintenance plugin can be downloaded from the official website or Baidu, and can be enabled after uploading. The maintenance time and user level displayed on the maintenance page can be set to ensure that the administrator can operate and browse normally in the background and foreground, while ordinary users will only see the maintenance prompt page.