admin管理员组

文章数量:1430077

During theme or plugin upgrades, maintenance mode is enabled and then disabled once complete.

Is it possible to manually enable / disable maintenance mode?

Enabling Maintenance mode... Downloading update from xxxx Disabling Maintenance mode...

During theme or plugin upgrades, maintenance mode is enabled and then disabled once complete.

Is it possible to manually enable / disable maintenance mode?

Enabling Maintenance mode... Downloading update from xxxx Disabling Maintenance mode...

Share Improve this question asked Dec 9, 2015 at 20:04 MiatiMiati 2132 silver badges5 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 7

WP-CLI now has native commands for it.

# Activate Maintenance mode
$ wp maintenance-mode activate
# Deactivate Maintenance mode
$ wp maintenance-mode deactivate

See wp-cli/maintenance-mode-command for more information.

You can enable maintenance mode in WordPress by adding a .maintenance file to your root WordPress directory. It will need to include:

<?php
$upgrading = time();

With this file in place, your site will be in maintenance mode until you remove the file.

I use a plug-in for maintenance mode and always leave it "in" maintenance mode.

Practically you can then turn on/off the actual maintenance mode by turning on/off that plugi-in — which is easy through wp-cli:

# activate maintenance mode, flush caches and stuff
wp plugin activate ultimate-maintenance-mode
# do maintenance things
wp plugin deactivate ultimate-maintenance-mode
# flush caches again so the maintenance page does not show up

本文标签: wp cliwpcli Enabling Maintainance Mode