How It Works
This section explains the technical behavior behind ID Maintenance Mode — how frontend blocking works, how the plugin handles caching, what the maintenance page response looks like, and how settings are stored.
Frontend Blocking
The plugin hooks into WordPress init at priority 1 — very early in the request lifecycle. On every frontend request, it checks:
- Is this an admin, AJAX, cron, REST API, XML-RPC, or login request? If so, skip — these are never blocked.
- Is maintenance mode enabled? If not, skip.
- Is the current user an administrator? Administrators always bypass.
- Does the visitor have a valid bypass cookie? If so, bypass.
- Otherwise, render the maintenance page and exit.
By hooking at init instead of template_redirect, the plugin fires before most caching plugins and server-level caches (Kinsta, WP Engine, etc.) have a chance to serve a cached page.
HTTP Response
The maintenance page returns:
- HTTP 503 (Service Unavailable) — tells browsers and search engines the outage is temporary.
- Retry-After: 3600 header — suggests search engines check back in one hour.
- No-cache headers — prevents browsers and CDNs from caching the maintenance page.
- robots: noindex, nofollow meta tag — prevents indexing of the maintenance page.
This combination ensures search engines don’t deindex your site or cache the maintenance page.
No-Cache Headers for All Frontend Requests
While maintenance mode is active, the plugin sends nocache_headers() on every frontend request — even for administrators and bypass users. This prevents a common problem with server-level caches: an admin browses the site, the cache stores the full page, and then a regular visitor gets the cached page instead of the maintenance page.
Cache Purging
When you toggle maintenance mode on or off, the plugin automatically attempts to purge full-page caches from:
- WordPress object cache
- Kinsta
- WP Engine (Varnish)
- SiteGround
- LiteSpeed Cache
- WP Super Cache
- W3 Total Cache
This ensures visitors immediately see the correct page after you toggle the setting.
Admin Bar Indicator
When maintenance mode is active, a Maintenance Mode item appears in the WordPress admin bar for administrators. It’s styled with a yellow background to stand out. Clicking it goes directly to the settings page. The indicator appears on both admin pages and the frontend.
Data Storage
All plugin settings are stored in a single WordPress option: idmm_settings. This option contains:
enabled— Boolean. Whether maintenance mode is active.bg_color— Hex color string for the page background.bg_image— URL of the background image (empty string if none).block_bg— Hex color ortransparentfor the content block background.content— HTML string from the rich text editor.bypass_key— Random 16-character string for the bypass URL.
Uninstalling
Deactivating the plugin disables maintenance mode but preserves all settings. Deleting the plugin removes the idmm_settings option from the database. Bypass cookies in client browsers will expire naturally after 7 days.
