Sometimes, one wants to put a wordpress installation into “Maintenance mode” from the command line. Assuming your wordpress blog is installed in /var/www/myblog.example.com/, the following command will put it in maintenance mode:
echo '<?php $upgrading = '"$(date +%s)"'; ?>' > /var/www/myblog.example.com/.maintenance
The following command will deactivate maintenance mode:
rm -f /var/www/myblog.example.com/.maintenance
(Last update on September 1, 2026 was done by Editor F.)