How to Enable Maintenance Mode Without Logging Into WordPress

When working on your WordPress site whether you’re updating themes, modifying code, or fixing plugin conflicts it’s best to put the site in maintenance mode. But what if you can’t log in to the WordPress admin dashboard due to an error or issue?

Good news: You can still enable maintenance mode without accessing the dashboard, directly via cPanel or FTP. This article will walk you through simple, safe methods to activate maintenance mode manually, so your visitors don’t see a broken or buggy site while you troubleshoot.

What Is Maintenance Mode in WordPress?

Maintenance mode is a temporary state where your website shows a friendly message like:

“We’re currently undergoing maintenance. Please check back soon.”

This ensures your visitors aren’t confused or alarmed if your site is half-loaded or broken during updates.

While WordPress automatically enables this during core updates, you can also manually trigger it using simple file edits — even without dashboard access.

Why Enable Maintenance Mode Manually?

You may need this if:

  • You’re locked out of wp-admin

  • A theme/plugin update broke the site

  • You’re doing file-level repairs

  • You want to pause public access temporarily during migration

Let’s look at three easy methods to do this using cPanel or FTP.

Method 1: Create a .maintenance File in the Root Directory

This is the most direct way to trigger WordPress maintenance mode.

Step-by-Step via cPanel:

  1. Log in to cPanel

  2. Open File Manager

  3. Navigate to the folder where WordPress is installed (usually public_html)

  4. Click + File and name it .maintenance

  5. Paste the following code inside:

<?php
$upgrading = time();
?>
  1. Save and close the file.

Now, when someone visits your website, they’ll see a default maintenance message like:

Briefly unavailable for scheduled maintenance. Check back in a minute.

To disable maintenance mode, simply delete the .maintenance file.

Method 2: Redirect Visitors Using .htaccess Rules

If you want more customization (like redirecting to a custom page), you can modify your .htaccess file.

Be cautious: .htaccess changes affect site behavior, so back up the file before editing.

How to Redirect Visitors:

  1. In File Manager, find your .htaccess in public_html

  2. Right-click and Edit

  3. Add this code above the WordPress rules:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123
RewriteRule ^(.*)$ https://yourdomain.com/maintenance.html [R=302,L]
  • Replace 123.123.123.123 with your IP address (so you can view the site)

  • Replace yourdomain.com/maintenance.html with your custom maintenance page

To disable, remove or comment out the code.

Method 3: Use a Plugin File Override (for advanced users)

If your site is semi-functional but admin is inaccessible, you can manually activate a plugin that puts your site in maintenance mode.

Example Using “WP Maintenance Mode” Plugin:

  1. Download the plugin ZIP from WordPress.org

  2. Unzip it locally

  3. Upload the plugin folder into wp-content/plugins/ via File Manager or FTP

  4. Open the wp-content/plugins/ directory

  5. Rename the plugin folder to something like zzz-wp-maintenance-mode (forces it to load early)

  6. The plugin will auto-activate if its maintenance.php file is configured to do so on load

Note: This method is best for those familiar with basic PHP and plugin structure.

How to Return the Site to Normal

Once your updates or fixes are complete:

  • Delete the .maintenance file (Method 1)

  • Revert .htaccess changes (Method 2)

  • Disable or remove manual plugins (Method 3)

Then, visit your homepage to confirm everything works as expected.

Tips to Avoid Future Lockouts

  • Always back up before making major changes

  • Use a staging environment if your host offers one

  • Consider installing a plugin that provides a maintenance toggle in advance

  • Monitor update behavior interrupted updates often leave behind .maintenance files

Conclusion

Getting locked out of WordPress doesn’t mean you’re out of options. With basic access to cPanel or FTP, you can put your site into maintenance mode, keeping things professional and user-friendly while you work behind the scenes.
Whether you’re doing emergency repairs or routine updates, these manual methods help protect your site’s appearance and user trust no admin login required.
Need help creating a custom maintenance page or checking if your .htaccess rules are safe? Reach out to our hosting provider’s support team for a second pair of eyes.