preloader

How to Create a Maintenance Mode Page in WordPress

Putting your WordPress site into maintenance mode shows visitors a custom page rather than a broken site while you work. There are three approaches: a maintenance mode plugin (easiest), triggering WordPress’s built-in maintenance state (free but limited), or a custom static HTML page served directly by your server (most reliable). The right choice depends on your situation and technical comfort.

Method 1: Maintenance Mode Plugin

Plugins like “WP Maintenance Mode” or Coming Soon Page & Maintenance Mode by SeedProd activate a custom maintenance page with minutes of setup. Install the plugin, enable maintenance mode, and customize the appearance – background image, headline, countdown timer, email signup form. The plugin redirects all frontend visitors to the maintenance page while allowing logged-in administrators to see the live site.

Key configuration: ensure the maintenance mode is set to “Maintenance Mode” (returns a 503 HTTP status) rather than “Coming Soon” (which typically returns 200). A 503 status tells search engines the site is temporarily unavailable and to come back later rather than deindexing content. A 200 status on a maintenance page can cause search engines to index the maintenance page itself.

Need help with your WordPress site? Describe your project and get a free estimate.

Method 2: WordPress Built-In Maintenance Mode

WordPress has a built-in maintenance state triggered by placing a file named .maintenance in the root of your WordPress installation (same directory as wp-config.php). Create the file with this content:

<?php $upgrading = time(); ?>

WordPress shows its default “Briefly unavailable for scheduled maintenance. Check back in a minute.” message to visitors. Delete the file to end maintenance mode. This is the same mechanism WordPress uses during plugin and theme updates. The default message is plain and not customisable without editing WordPress core files (do not do that). Use this method only for brief server-side work where the custom appearance does not matter.

Method 3: Htaccess Redirect (Most Reliable)

For major server work where WordPress itself may be unavailable (server migration, database maintenance), an htaccess redirect serves a static HTML file without touching WordPress. Create a static maintenance.html file in your web root. Then add to your .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/maintenance.html$
RewriteCond %{REMOTE_ADDR} !^123.456.789.000$ # your IP
RewriteRule ^(.*)$ /maintenance.html [R=302,L]

This redirects all visitors except you (replace the IP with your actual IP) to the static maintenance page. This works even if WordPress is broken.

Adding a Countdown Timer and Email Capture

Maintenance mode plugins typically include countdown timers and email capture forms. For a custom static maintenance page, add a countdown using JavaScript:

<div id="countdown"></div>
<script>
const target = new Date('2025-06-01T09:00:00').getTime();
const x = setInterval(() => {
  const now = new Date().getTime();
  const diff = target - now;
  const d = Math.floor(diff / (1000*60*60*24));
  const h = Math.floor((diff % (1000*60*60*24)) / (1000*60*60));
  document.getElementById('countdown').innerHTML = d + 'd ' + h + 'h remaining';
  if (diff < 0) { clearInterval(x); document.getElementById('countdown').innerHTML = 'Launching soon!'; }
}, 1000);
</script>

Keep Reading

Previous Post How to Add Custom CSS in WordPress Next Post How to Add a Custom Field to WooCommerce Checkout

Need Help With Your WordPress Site?

If you need help with WordPress fixes, plugin issues, theme customization, or development work, feel free to get in touch.

Get a Free Estimate