Your site needs downtime. Visitors need to know.
You're migrating the database. Or restructuring the product catalog. Or deploying a major update that takes 20 minutes. During that window, visitors see broken pages, missing images, or PHP errors.
WordPress has a built-in maintenance mode that shows "Briefly unavailable for scheduled maintenance", an unstyled white page that looks like the site crashed. Not exactly the message you want to send.
What most people do instead
How to enable maintenance mode in WordPress without a plugin
You can do this by hand. The cleanest no-plugin route is a must-use plugin, a single PHP file in wp-content/mu-plugins/, that intercepts frontend requests and returns a 503 while letting logged-in admins through:
// wp-content/mu-plugins/maintenance.php
add_action( 'template_redirect', function () {
if ( current_user_can( 'manage_options' ) ) {
return; // logged-in admins keep browsing the live site
}
wp_die(
'We are upgrading the site. Back in a few minutes.',
'Maintenance',
array( 'response' => 503 )
);
} ); Drop that file in place and anonymous visitors get a 503 while you keep working. Because it lives in mu-plugins, it survives theme switches. The trade-offs are real:
- The page is the plain unstyled
wp_diescreen, no headline, branding, or layout beyond what you hardcode. - There is no on/off toggle, you edit the file to change the message and delete it to go live again.
- Get the capability check wrong and you can lock yourself out of the front end too.
It is fine if you live in code. If you would rather have a branded page and a one-click revert, the next section does the same thing from one command.
A better way: branded maintenance page, one command
Open the navigator. Type maintenance mode with an optional headline and message. Every frontend request returns a clean 503 page with your text. Logged-in admins bypass it and see the real site so they can keep working.
Shown in advanced mode, where commands start with tp. In easy mode you type the same command without the tp prefix.
Returns proper 503 status. Search engines see "temporarily unavailable" and come back later. Your rankings aren't affected by short maintenance windows.
How it works
maintenance mode or tp maintenance mode -headline=Upgrading -message=Back in 10 minutes| Detail | Value |
|---|---|
| Command name | maintenance mode |
| Custom headline | -headline=We'll be right back |
| Custom message | -message=Upgrading to serve you better |
| HTTP response | 503 Service Unavailable (SEO-safe) |
| Bypasses | Logged-in users, wp-admin, REST API, AJAX, cron |
| Can be used in |
Real example
It's 2am. You're migrating a client's WooCommerce database to a new server. The migration takes 15 minutes and during that time, product pages will show errors and the checkout will break.
Before starting, you enable maintenance mode with a custom message: "We're upgrading our store. Back in 15 minutes." Every visitor sees a clean page. Google gets a 503 and knows to come back later. Your SEO rankings stay untouched.
You finish the migration, verify everything works from your logged-in session (you never saw the maintenance page), and remove the startup command entry. The store is live again. Zero customer complaints, zero broken checkout screenshots.
Goes further with TrueCommander
Frequently asked questions
template_redirect and calls wp_die() with a 503 response for non-admins, as shown above. The trade-off is a plain unstyled page and no on/off toggle, you edit or delete the file to change it. TrueCommander does the same thing with a branded page and a startup toggle to revert.503 Service Unavailable status. Google reads a 503 as temporary and comes back later, so short maintenance windows do not affect rankings. The risk is serving a 200 OK "coming soon" page for days, which can get indexed..maintenance file automatically during updates and shows an unstyled default message for the few seconds it takes. This command gives you a branded page you control, an admin bypass, and an explicit on/off instead of a file that appears and disappears on its own.