WordPress live-site editing

Stop letting visitors catch the site mid-change

Maintenance Mode closes the public site to anyone not logged in while work is underway, showing a custom HTML page, or redirecting to a page or URL instead — so a visitor arriving mid-edit sees an honest message, not a half-updated layout or an error.

  • Three destination modes: custom HTML, an existing page, or any URL.
  • Redirect-loop protection built into both the page and URL modes.
  • Matches WordPress core's own maintenance-mode HTTP behavior.
  • Logged-in staff pass straight through, automatically.
What Visitors SeeMaintenance Mode

What visitors see

VisualCode
Custom HTML pageRedirect to a PageRedirect to a URL

Full HTML shown to guests on every page while maintenance mode is active. Leave empty to use the default message.

We're upgrading a few things and will be back shortly.
example.com
Example SiteWe're upgrading a few things and will be back shortly.
An honest message, not a broken layoutLogged-in staff bypass it completely.
Active
Quick answer

What does Maintenance Mode do?

When the maintenance_mode module is active, TOWP_Maintenance_Mode intercepts every front-end request from a visitor who isn't logged in, at the earliest point WordPress offers, before any other module gets a chance to serve or redirect it. By default it renders a full HTML page with a proper 503 status and Retry-After header, matching how WordPress core's own built-in maintenance screen behaves; instead, it can redirect to an existing page or any URL. The REST API gets its own dedicated 503 response, and since logged-in users bypass the entire mechanism automatically, wp-admin and the login screen never get gated.

The "half-finished layout" problem

A live edit, seen by someone who has no idea it's in progress

Since editing directly on a live site happens in full view of anyone browsing at the wrong moment, the results are often visible before they're finished.

A visitor mid-edit sees breakage, not an explanation

Working directly on a live site risks a visitor landing on a half-updated layout, a broken block, or a plain error, with nothing telling them what's actually going on.

Silence looks worse than an honest message

A page that simply looks wrong reads as neglect, while a page that says maintenance is underway reads as normal, expected upkeep.

Here's the fix

An honest message, however the work needs to happen

The module closes the public site cleanly while work continues, with three ways to decide exactly what a visitor sees.

A custom HTML page, written once

Write a full page in Visual or Code mode, or instead leave it blank for a polished default message that still matches the site's own branding.

Redirect to a page or URL instead

Send visitors to an existing page on the site, or to any other address, instead of showing a maintenance message at all.

Staff keep working, uninterrupted

Anybody already logged in bypasses maintenance mode entirely, and maintenance mode never touches wp-admin or the login screen.

Verified feature set

Careful engineering, not just a message

Every capability below is present in the supplied PHP class and its settings registration.

Matches WordPress core's own maintenance behavior

503 status, Retry-After header, no caching

The default page responds the same way WordPress's own built-in upgrade-maintenance screen does, telling crawlers and browsers exactly how to treat the response.

HTTP 503Retry-After: 3600
Redirect-loop protection on both modes

Neither Page nor URL mode can loop forever

Page mode checks whether the visitor is already on the destination page before redirecting, and similarly, URL mode compares the current request against the target address, so neither mode can send a visitor in circles.

is_page() checkis_current_url() comparison
Never left silently inert

A safe fallback if a destination isn't set yet

If Page or URL mode is selected but no actual destination has been configured, the module falls back to the custom HTML page instead of leaving the site fully open.

No accidental bypassFallback to custom HTML
Full HTML, deliberately not filtered

A complete page, not sanitized post content

The custom HTML field skips the standard content filter specifically because it would strip the html, head, and style tags a full standalone page actually needs.

Unfiltered by designFull document support
External redirects actually work

The same wp_safe_redirect() fix used elsewhere

A configured URL destination gets its host added to the allowed redirect list, so an external address doesn't silently fall back to the homepage.

allowed_redirect_hostsPrevents silent fallback
Practical use cases

Where an honest gate helps most

The module supports any moment when the public site genuinely shouldn't show what's currently happening behind it.

Live edits on a site that's already public

Close the site cleanly while making changes that would otherwise be visible mid-update to anyone browsing at the wrong moment.

Major updates, migrations, or theme changes

Show a clear, on-brand message for the duration of a bigger change, rather than an unpredictable broken state.

Redirecting an entire site elsewhere temporarily

Send every guest to a specific page or an external address during a transition, without touching the site's actual content.

Operational benefits

A cleaner pause, not a visible mess

The module combines a genuinely honest visitor experience with defenses against the classic maintenance-mode mistakes.

A message that explains itselfA visitor who lands on the site mid-change sees exactly what's happening, instead of guessing whether something actually broke.
Flexible enough for more than just a messageRedirecting to a page or URL covers scenarios a static message alone wouldn't, like sending visitors to a temporary landing page.
No risk of an infinite redirectBoth redirect modes check for the visitor already being at the destination, so a misconfiguration can't send anyone in a loop.
Zero disruption for the team doing the workStaff keep full access automatically, with nothing extra to remember while maintenance mode is active.
Performance behaviour

One early check, then nothing else

The verified implementation stays lightweight regardless of which mode is active.

One early check, then nothing else

The check runs once per request, at the earliest point WordPress offers, before any other page logic executes for a gated visitor.

No effect on a logged-in visit

The check exits immediately for anyone logged in, adding no overhead to the normal admin or staff experience.

A single HTML render, no database-heavy logic

Showing the maintenance page is a straightforward render; the redirect modes involve only a lightweight status and path comparison.

Security implementation

Visibility control, not access control

The code changes what a guest sees, never what an account can actually do.

01

A visibility control, not an access-control mechanism

This module changes what a guest sees, not what any user account can actually do; it has no effect on any capability or permission.

02

External redirects are explicitly whitelisted, not opened broadly

The module adds only the host of a destination actually configured in the settings to the allowed list, not an open pass for any external URL.

03

The custom HTML field is trusted content, by design

Since only an administrator can set it, the module skips post-content filtering on the full HTML field deliberately, rather than by oversight.

04

Configuration requires the same access as any other setting

Choosing a mode and its destination happens through the standard TheOneWP settings screen, available only to an administrator.

Verified compatibility

Built directly around WordPress's own request and REST APIs

The supplied code integrates through APIs present in WordPress core; this page makes no compatibility claim beyond the verified implementation.

Front-end request interception

template_redirect action, priority 0

The native WordPress action used to intercept and gate every front-end page request before rendering begins.

template_redirectPriority 0
REST API authentication

rest_authentication_errors filter

The native WordPress filter used to reject a REST API request from a logged-out visitor with a proper 503 error.

rest_authentication_errorsNative REST filter
External redirect safety

allowed_redirect_hosts filter

The native WordPress filter used to permit wp_safe_redirect() to send a guest to an external host when explicitly configured.

allowed_redirect_hostsNative filter
Solution comparison

TheOneWP versus common alternatives

Compare the verified Maintenance Mode implementation with a typical single-message plugin.

CapabilityTheOneWP Maintenance ModeOther common solutions
Destination flexibility Custom HTML, an existing page, or any URLOften a single fixed maintenance message with no redirect option
Redirect-loop protection Built into both Page and URL modesA common oversight that can send visitors in circles
HTTP correctness 503 status and Retry-After, matching WordPress coreSome approaches return a normal 200 status, misleading crawlers
Fallback behavior Never left inert if a destination isn't configuredA misconfigured redirect can leave the site fully open by mistake
REST API coverage A dedicated 503 check, closing a separate vectorFrequently left open even when the HTML pages are gated
Recommended workflow

Close the site cleanly in four steps

Confirm the expected page or redirect from a logged-out view before starting the actual work.

01

Enable Maintenance Mode

Activate the module from the TheOneWP System settings tab.

02

Choose what visitors see

Pick Custom HTML page, Redirect to a Page, or Redirect to a URL, based on what fits the situation.

03

Configure the destination

Write the HTML message, select the page, or enter the URL, depending on the mode chosen.

04

Confirm as a logged-out visitor

Open the site in a private browser window and confirm the expected page or redirect appears.

Best practices

Match the message to how long the work will actually take

The right approach depends mostly on how visible and how long the change actually is.

01

Leave the custom HTML field blank for routine, short maintenance

The polished default message covers most situations without needing to write anything.

02

Write a custom message for longer or more visible work

A specific message, even just a rough time estimate, therefore reads better than a generic notice for anything longer than a quick fix.

03

Use Redirect to a Page for content that still needs to be reachable

An existing page, like a status update or contact page, can stay genuinely useful during maintenance rather than being replaced by a static message.

04

Turn it off deliberately once work is finished

Disable the module explicitly instead of assuming it will simply stop mattering once changes finish.

Common mistakes

Avoid a couple of details worth understanding first

A few behaviors are easy to misjudge the first time through.

Selecting Page or URL mode without setting a destination

The module falls back to the custom HTML page automatically in that case, so the site won't accidentally stay open, but it's still worth configuring the actual destination.

Assuming the custom HTML field gets sanitized like post content

The field intentionally skips standard content filtering, so a full HTML document, including its own head and style tags, renders correctly.

Forgetting search engines see the maintenance page too

The 503 status and Retry-After header tell search engines this is temporary, but leaving maintenance mode on far longer than expected can still affect how a site is perceived.

Frequently asked questions

Maintenance Mode FAQ

These answers come directly from the verified class and its settings registration.

What does Maintenance Mode do?

It closes the public site to anyone not logged in, showing a custom HTML page, or redirecting to a page or URL, while work is underway.

Does this affect logged-in users?

No. Anybody already logged in bypasses maintenance mode entirely, and it never touches wp-admin or the login screen.

What happens if I don't write any custom HTML?

A polished default message appears instead, styled to match the site's own branding.

Can maintenance mode redirect visitors instead of showing a message?

Yes. Redirect to a Page or Redirect to a URL sends visitors somewhere else entirely instead of displaying a message.

Can a redirect destination cause an infinite loop?

No. Both redirect modes check whether the visitor is already at the destination before redirecting, preventing a loop.

What happens if I choose Page or URL mode but don't set a destination?

The module falls back to the custom HTML page automatically, rather than leaving the site fully open.

Is the REST API affected too, or just the pages?

Both. A separate check specifically returns a 503 response for the REST API.

Does this return the correct HTTP status for search engines?

Yes. The default page responds with a 503 status and a Retry-After header, matching how WordPress's own built-in maintenance screen behaves.

Is the custom HTML field sanitized like normal post content?

No. It's left unfiltered deliberately, since standard content filtering would strip the tags a full HTML page actually needs.

Who can configure Maintenance Mode?

Only an administrator with access to the TheOneWP settings screen.

Stop letting visitors catch a half-finished layout.Show an honest message while the work happens.

Use Maintenance Mode to close the public site with a custom page or a redirect, with staff bypassing it automatically and both redirect modes protected against loops.