FLASH SALE Get 20% OFF everything using the coupon code: FLASH20 View Pricing Plans →

How to Put WordPress in Maintenance Mode: 4 Simple Methods

Tired of holding your breath every time you update your WordPress site, hoping visitors don’t see something broken? We get it! There’s nothing worse than knowing that potential customers might encounter error messages or half-finished pages during your work. 

Maintenance mode creates a professional buffer, displaying a friendly message while you make those crucial changes behind the scenes.

How to Put WordPress in Maintenance Mode

In this guide, we’ll walk through four effective methods to enable maintenance mode, tailored for every skill level. From point-and-click plugin solutions to custom code approaches, you’ll find the perfect option for your needs. Let’s make website maintenance stress-free!


Table of Contents

  1. Method 1: Using a Maintenance Mode Plugin
  2. Method 2: Using WPCode Plugin for Maintenance Mode
  3. Method 3: Manually Enabling Maintenance Mode through functions.php
  4. Method 4: Using the .htaccess File for Maintenance Mode
  5. Troubleshooting When Your Site Is Stuck in Maintenance Mode
  6. When and Why You Should Use Maintenance Mode

Method 1: Using a Maintenance Mode Plugin

Plugins offer the simplest solution for beginners looking to enable maintenance mode without touching code. These tools let you create custom maintenance pages with just a few clicks, protecting your site while keeping visitors informed about your progress.

Several WordPress maintenance mode plugins can help you set up maintenance mode efficiently:

  1. Maintenance: A popular free option with customization features
  2. LightStart: Formerly known as WP Maintenance Mode, this plugin offers seamless WordPress integration
  3. SeedProd: Provides beautiful templates and advanced customization options

Let’s walk through how to set up maintenance mode using the Maintenance plugin, a beginner-friendly option that doesn’t require coding knowledge.

Step-by-Step Setup with the Maintenance Plugin

1. Install and activate the Maintenance plugin from the WordPress Plugin Repository.

Navigate to Plugins > Add New Plugin in your WordPress dashboard.

Add new plugin

Search for “Maintenance,” and click Install Now followed by Activate.

Maintenance plugin install

2. Access the settings by going to Maintenance in your WordPress dashboard.

Maintenance plugin settings

Design your maintenance page by customizing these elements:

  • Title and message (explain why your site is under maintenance)
  • Background image or color scheme to match your brand
  • Logo display options
  • Font styles and text colors

3. Configure essential settings:

  • Enable the 503 Service Temporarily Unavailable status code to inform search engines your site is temporarily down
  • Exclude specific user roles so team members can still access the site
  • Set up Google Analytics tracking to monitor traffic during maintenance
  • Create a countdown timer if you know when the work will be completed

5. Save your changes and activate maintenance mode by toggling the “Maintenance Mode” switch to “On.”

6. Test your maintenance page by opening your site in an incognito window or a different browser where you’re not logged in. This lets you see exactly what visitors will experience.

The plugin creates a temporary barrier between your site and visitors, displaying your custom message instead of your regular content. Meanwhile, logged-in administrators can still view and work on the site normally.

Should you need to adjust your maintenance page, simply return to the plugin settings and update your design or message. When your maintenance work is complete, just toggle the switch back to “Off” to make your site publicly accessible again.


Method 2: Using WPCode Plugin for Maintenance Mode

If you prefer working with code snippets rather than installing dedicated maintenance plugins, WPCode offers an excellent alternative. This versatile plugin lets you implement maintenance mode through pre-written code while avoiding direct edits to your theme files.

1. Install and activate the WPCode plugin from the WordPress Plugin Repository. Go to Plugins > Add New, search for “WPCode,” click Install Now, and then Activate.

WPCode plugin

2. Access the snippet library by navigating to Code Snippets > Library in your WordPress dashboard.

WPCode code snippets library

The plugin includes a ready-made snippet designed explicitly for this purpose.

3. Find the maintenance mode snippet by typing “maintenance” in the search bar. Insert the code by clicking Use Snippet on the maintenance mode option.

WPCode - Maintenance Mode snippet

WPCode will automatically add the necessary code to your site without you having to write it yourself.

5. Customize your message in the snippet editor. You can modify the heading, text, and basic styling to match your brand voice.

6. Activate the snippet by toggling the switch from Inactive to Active at the top of the snippet editor. Click Update to apply your maintenance mode.

WPCode - Maintenance Mode snippet settings

7. Test your site in an incognito window to verify that the maintenance mode works properly. Regular visitors will see your maintenance message, while administrators can access the dashboard.

This method offers several advantages for users who want a lightweight solution. You avoid installing another dedicated plugin, gain precise control over your maintenance message, and can quickly toggle maintenance mode on or off with a single click.

The standard WPCode maintenance snippet also includes logic to allow administrators to continue working on the site while keeping it hidden from regular visitors. This functionality makes it particularly useful for quick maintenance tasks or updates that only take a short time to complete.

When you finish your maintenance work, simply return to Code Snippets > All Snippets, find your maintenance mode snippet, and deactivate it to restore public access to your website.


Upgrade Your Website with a Premium WordPress Theme

Find a theme that you love and get a 20% discount at checkout with the FLASH20 code

Choose your theme

Method 3: Manually Enabling Maintenance Mode through functions.php

Advanced users comfortable with code might prefer direct control over maintenance mode without relying on plugins. This approach involves adding custom PHP code to your theme’s functions.php file, giving you complete flexibility over how maintenance mode operates.

1. Access your functions.php file using the WPIDE plugin, your hosting file manager, or FTP. If using WPIDE, navigate to WPIDE > File Manager in your WordPress dashboard, accesss your theme files from the themes folder and select functions.php.

WPIDE file manager

2. Add this code snippet at the end of your functions.php file:

function wp_maintenance_mode() {
    if (!current_user_can('edit_themes') || !is_user_logged_in()) {
        wp_die('<h1>Under Maintenance</h1><p>We are currently making improvements to enhance your experience. Please check back soon!</p>');
    }
}
add_action('get_header', 'wp_maintenance_mode');

3. Save your changes after adding the code. The maintenance mode will activate immediately.

4. Verify functionality by opening your site in a new browser where you’re not logged in. You should see the maintenance message instead of your regular website.

This code works by checking if the current visitor has permission to edit themes or is logged in. If not, it displays a maintenance message using WordPress’s wp_die() function. The message appears before the header loads, ensuring visitors never see your actual site content.

The beauty of this method lies in its simplicity and customization options. You can modify the HTML within wp_die() to create more elaborate maintenance pages, including custom styling, images, and additional information.

For example, you might enhance the message to include:

  • Your company logo
  • Contact information
  • Expected completion time
  • Links to your social media profiles

Remember to create a backup of your functions.php file before making changes. A single syntax error could make your site inaccessible, so having a backup provides a safety net.

When your maintenance work finishes, simply remove the entire code block from functions.php to restore public access to your website. Make sure to delete only the maintenance mode code you added, not other essential theme functions


Method 4: Using the .htaccess File for Maintenance Mode

For developers and multisite users, the .htaccess approach offers server-level control over the maintenance mode. This method works by redirecting all visitors to a static maintenance page, making it particularly effective for WordPress multisite installations or when making server configuration changes.

1. Create a maintenance HTML file using any text editor like Notepad or TextEdit. Add your custom maintenance message with basic HTML formatting:

<!DOCTYPE html>
<html>
<head>
    <title>Site Maintenance</title>
    <style>
        body { 
            font-family: Arial, sans-serif; 
            text-align: center; 
            padding: 50px; 
            background: #f5f5f5; 
        }
        h1 { color: #333; }
        p { color: #666; }
    </style>
</head>
<body>
    <h1>We're Improving Our Website</h1>
    <p>We're currently making updates to enhance your experience. Please check back soon!</p>
    <p>Thank you for your patience.</p>
</body>
</html>

2. Upload this file to your WordPress root directory (the same location as wp-config.php) and name it “maintenance.html“.

3. Locate your .htaccess file in the same root directory. You can access it through your hosting file manager or FTP client.

FileZilla - htaccess

4. Add these rules to the beginning of your .htaccess file, before any WordPress rules:

RewriteEngine On
RewriteBase /
%{REQUEST_URI} !^/maintenance\.html$
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.0$
RewriteRule ^(.*)$ /maintenance.html [R=307,L]

5. Replace 123.456.789.0 with your own IP address to allow yourself access to the site. You can find your IP by searching “what is my IP” on Google.

6. Save the .htaccess file and test your site by visiting it in a different browser or incognito window.

This approach uses the server’s rewrite rules to temporarily redirect all traffic to your maintenance page. The 307 status code tells browsers and search engines that this redirection is temporary, helping to preserve your SEO rankings during maintenance.

The second RewriteCond line creates an exclusion for your IP address, allowing you to view and work on the actual site while everyone else sees the maintenance page. You can add multiple IP addresses by duplicating this line for each one.

For multisite installations, this method works particularly well because it applies the maintenance mode at the server level, affecting all sites in your network simultaneously.

When maintenance completes, simply remove the added rules from your .htaccess file to restore normal site access. Ensure you only remove the maintenance-specific rules you added, preserving WordPress’s default .htaccess content.


Upgrade Your Website with a Premium WordPress Theme

Find a theme that you love and get a 20% discount at checkout with the FLASH20 code

Choose your theme

Troubleshooting When Your Site Is Stuck in Maintenance Mode

Sometimes, WordPress sites can get stuck in maintenance mode even after you try to turn it off. This typically happens when updates are interrupted or when there’s a conflict with plugins or themes. Here’s how to fix these common issues:

1. Removing the .maintenance File

When WordPress performs automatic updates, it creates a temporary .maintenance file in your root directory. If an update fails, this file might not get deleted automatically:

1. Connect to your website using FTP or your hosting provider’s file manager

2. Navigate to your WordPress root directory (where wp-config.php is located)

3. Look for a file called .maintenance (note the period at the beginning)

4. Delete this file if found

Delete the .maintenance file

5. Refresh your website to see if it resolves the issue

The .maintenance file might be hidden by default in some file managers. If you can’t see it, check your file manager settings to show hidden files.

2. Clearing WordPress Cache

Persistent caching can sometimes make your site appear to be in maintenance mode even after you’ve disabled it:

  1. Clear any caching plugin’s cache (WP Rocket, W3 Total Cache, etc.)
  2. Ask your hosting provider to clear server-level caches if available
  3. Clear your browser cache or test in an incognito window

Remember that CDN services might also cache your maintenance page. Check your CDN settings to purge these caches if necessary.

3. Deactivating Problematic Plugins

If a plugin conflict is causing the issue:

  1. Access your wp-content/plugins/ folder via FTP
  2. Rename the entire plugins folder to something like “plugins_old”
  3. Check if your site exits maintenance mode
  4. If it does, rename the folder back to “plugins”
  5. Deactivate plugins individually by renaming each plugin folder until you identify the problematic one

This method effectively deactivates all plugins without requiring dashboard access, helping you isolate plugin-related issues.

4. Checking Theme Conflicts

Theme issues can also cause maintenance mode problems:

  1. Switch to a default WordPress theme like Twenty Twenty-Five
  2. If this resolves the issue, your custom theme might contain problematic code
  3. Check your theme’s functions.php file for maintenance mode code that wasn’t properly removed

Default themes provide a stable baseline to help determine if your issue stems from theme customizations.

5. Hosting Panel Settings

Some hosting providers include their own maintenance mode features:

  1. Check your hosting control panel for any maintenance mode settings
  2. Turn off any host-level maintenance mode that might be active
  3. Contact your hosting support if you can’t locate these settings

This often affects managed WordPress hosting where providers include additional features beyond standard WordPress functionality.

By working through these troubleshooting steps systematically, you can identify and resolve most maintenance mode issues. If problems persist, creating a staging copy of your site allows you to troubleshoot safely without affecting your live website.

For more detailed instructions on resolving the default WordPress maintenance message, see our complete guide: How to Fix ‘Briefly Unavailable for Scheduled Maintenance’ in WordPress.


When and Why You Should Use Maintenance Mode

Putting your WordPress site in maintenance mode isn’t necessary for every minor update, but certain situations make it essential. Understanding when to activate this feature helps maintain professionalism and protect your site during significant changes.

Key Situations That Require Maintenance Mode

  • Major WordPress updates demand temporary downtime to prevent compatibility issues. When updating core files, critical plugins, or your theme, maintenance mode shields visitors from seeing error messages or broken layouts during the process.
  • Website redesigns benefit greatly from maintenance protection. Whether switching to a new theme or restructuring your site architecture, these changes can temporarily break your site’s appearance or functionality. Maintenance mode keeps these works-in-progress hidden until they are ready for launch.
  • Performance optimizations often require background work that might affect site speed or functionality. Database cleanup, caching configuration, or server adjustments work best behind a maintenance screen rather than subjecting visitors to slow loading times or intermittent errors.
  • Security updates sometimes necessitate taking your site offline briefly. When removing malware, implementing firewall changes, or recovering from security breaches, maintenance mode prevents further exposure while you secure your site.
  • SEO-focused modifications like URL structure changes or content reorganization can create temporary navigation issues. The maintenance mode prevents users and search engines from encountering broken links or redirects during these transitions.

Benefits of Using Maintenance Mode

Maintenance mode delivers several advantages beyond simply hiding your work:

  • The visitor experience improves when users see a professional maintenance page instead of a broken website. A well-designed notice builds trust by communicating that improvements are underway rather than leaving visitors wondering if your site has technical problems.
  • Data protection becomes more reliable during updates. Without maintenance mode, you risk losing new comments, form submissions, or even ecommerce orders that might occur during your update process.
  • SEO value stays intact when you implement maintenance mode correctly. Using the proper 503 Service Temporarily Unavailable status code, you signal to search engines that your site is temporarily down for maintenance rather than permanently gone, preserving your rankings.
  • Professional image remains consistent even during downtime. A branded maintenance page with your logo and a clear message reflects better on your business than error messages or partially functional pages.

For optimal results, try to schedule maintenance during low-traffic periods and provide an estimated completion time when possible. This transparency helps manage visitor expectations while you improve your site.


Maintenance Mode Mastered, What’s Next?

Congratulations! You now know exactly how to shield your WordPress site during updates, keeping your professional image intact. Whether you’re making minor tweaks or major overhauls, maintenance mode has your back. Ready to take your WordPress site to new heights? 

Consider exploring WPZOOM’s thoughtfully designed themes that make future maintenance more manageable and less frequent. With optimization built right in, you’ll spend less time in maintenance mode and more time enjoying your beautiful, functional website. Your WordPress journey just leveled up. What will you create next?

Related Posts

Upgrade Your Website with a Premium WordPress Theme

Find a theme that you love and get a 20% discount at checkout with the FLASH20 code

Choose your theme
Subscribe to the WPZOOM newsletter.

Join 150,000 people. Get our latest news & releases delivered to your inbox.

Leave a Reply

*

*