
How to Set Up Maintenance Mode in WordPress Using cPanel
How to Set Up Maintenance Mode in WordPress Using cPanel
What is Maintenance Mode in WordPress?
Maintenance mode temporarily disables access to your website’s public pages, displaying a simple message like “We’ll be back soon” while you make updates, install plugins, or change themes. It helps keep your site professional and user-friendly during backend work.
Method 1: Create a .maintenance
File Using cPanel File Manager
- Log into your cPanel via your hosting provider.
- Click on File Manager under the “Files” section.
- Navigate to your site root directory:
/public_html/
- Click on + File at the top and name the file:
.maintenance
- Edit the file and paste the following code:
<?php $upgrading = time(); ?>
- Save the file and close the editor.
Result: WordPress now displays its default “Briefly unavailable for scheduled maintenance” message to visitors.
Method 2: Create a Custom Maintenance Page
If you want a custom message, follow these extra steps:
- In the same
/public_html
folder, create a new file calledmaintenance.html
- Insert custom HTML like this:
<!DOCTYPE html> <html> <head><title>Maintenance Mode</title></head> <body> <h1>Site Under Maintenance</h1> <p>We are currently working on updates. Please check back soon.</p> </body> </html>
- Create or edit the
.htaccess
file and insert:RewriteEngine On RewriteCond %{REQUEST_URI} !/maintenance.html$ RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123 RewriteRule ^(.*)$ /maintenance.html [R=302,L]
- Replace
123.123.123.123
with your IP address to allow admin access during maintenance.
Method 3: Use a Maintenance Mode Plugin (Alternative)
If you prefer not to use cPanel, you can log in to WordPress and install one of the following plugins:
- WP Maintenance Mode
- SeedProd – Maintenance, Coming Soon & Landing Pages
- Maintenance by WebFactory
These plugins offer customizable maintenance templates, countdowns, and even newsletter signup forms.
How to Turn Off Maintenance Mode
To bring your site back online:
- Delete the
.maintenance
file in/public_html
. - Or remove the rewrite rules and maintenance.html file if using the .htaccess method.
- If using a plugin, disable it from your WordPress dashboard.
Final Tips
- Use 302 redirects (temporary) to avoid SEO penalties.
- Always test the maintenance page in a different browser or incognito mode.
- Whitelist your IP address to retain admin access.