How to temporarily shut down WordPress website for maintenance

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.

Related Article
WordPress displays the registration time of the login user in the frontend

When using WordPress to build a website, some users want to display the user registration time in the frontend, but Read more

WordPress adds the number of SQL queries at the bottom

An excellent woodpress theme is definitely that the less SQL consulting is used, the better. How can we see how Read more

Some WordPress articles can be seen after comments / replies

If we want to hide part of the content of the article and need the user's comments and replies to Read more

WordPress common template function reference document

Basic template filefile namedescribe style.css Theme style file index.php Home page template file header.php Header template file single.php Single article Read more

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image