WordPress maintenance mode is controlled by a single file in the WordPress root directory. Every site your agency manages can be flipped into maintenance mode from one terminal session, without logging into a single admin panel. This guide covers three scripting approaches that work across a fleet, the verification step most agencies skip, and the client communication runbook that should accompany every maintenance window you schedule.
Yes. WordPress maintenance mode is controlled by a single file (.maintenance) in the WordPress root directory. You can activate and deactivate it using WP-CLI, a bash script over SSH, or by writing and deleting the file directly on the server. No third-party software is required.
WordPress only respects the .maintenance file if the timestamp inside it is within 600 seconds (10 minutes) of the current time. For longer maintenance windows, refresh the file every 9 minutes by rewriting it with an updated timestamp, or use WP-CLI’s maintenance-mode command, which handles this automatically.
Yes. By default, WordPress allows logged-in administrators to bypass the maintenance screen and view the site normally. This is useful for verification after activation, but it means any client contacts with administrator accounts can also access the site during the window.
Create a file named maintenance.php inside your wp-content/ directory. WordPress will serve this file instead of the default maintenance message whenever the .maintenance file is active. Your custom page can include your agency branding, an estimated return time, and an emergency contact number for urgent issues.
The most reliable approach for a fleet is WP-CLI over SSH, called in a loop across all sites. WP-CLI handles the timestamp refresh automatically, so the 10-minute expiry is not a concern for longer windows. For agencies running WPOS, maintenance mode is issued as a single site agent command that activates the entire fleet and logs each window to the site’s Playbook.
1,000 free credits. Just describe what you need.
See It In ActionNew to WPOS? Learn what WPOS is and how agencies use it to build and operate client WordPress sites with AI agents.
Part of our guide: How to Run a WordPress Agency at Scale.