How to improve Magento 1 maintenance mode

Key takeaways:

  • Magento 1 maintenance mode uses a maintenance.flag file.
  • Default maintenance mode can block customers, admins, and developers.
  • You can improve it by allowing trusted IPs through index.php.
  • Use backups, testing, a custom 503 page, and cleanup after launch.

Magento 1 maintenance mode allows you to restrict customer access to your store while performing site maintenance. Unfortunately, it can also freeze you out of the store. Add the following code to your index.php file to allow approved users to keep working on the site while everyone else sees the Magento 1 maintenance mode page.

Host Magento at full throttle.

Get secure, reliable Magento hosting so you can scale faster.

    What is Magento 1 maintenance mode?

    Magento 1 maintenance mode is a built-in way to temporarily take your store offline. It works by checking for a file named maintenance.flag in the Magento root directory, near index.php.

    When that file exists, Magento shows visitors a maintenance page instead of the normal storefront. This helps prevent customers from browsing or placing orders while you make updates, troubleshoot issues, change extensions, update design elements, or perform server maintenance.

    The challenge is that Magento 1’s default maintenance mode can also block frontend and admin access, which makes live testing harder.

    How to enable Magento 1 maintenance mode

    To turn on Magento 1 maintenance mode:

    1. Connect to your server using FTP, SFTP, or SSH.
    2. Go to the Magento 1 root directory where index.php is located.
    3. Create an empty file named exactly maintenance.flag.
    4. Save or upload the file in the root directory.
    5. Visit the site to confirm the maintenance page appears.

    Make sure the filename is exact. A misspelled file name or a file placed in the wrong directory will not work.

    How to disable Magento 1 maintenance mode

    To turn off Magento 1 maintenance mode:

    1. Connect to your server using FTP, SFTP, or SSH.
    2. Go to the Magento 1 root directory.
    3. Delete the maintenance.flag file.
    4. Refresh the storefront and admin panel to confirm access is restored.

    If the maintenance page still appears, check that the file was removed from the correct directory. 

    How to allow developer IPs during Magento 1 maintenance mode

    Step 1: Open index.php

    Open the index.php file in the Magento root directory.

    Step 2: Add allowed IP addresses

    Above line 64, add the following and include the IPs to retain access to the site in the “allowed” array:

    Replace the example IP addresses with the public IP addresses that should be allowed to access the store during maintenance.

    Step 3: Update the maintenance mode condition

    Locate and change the line:

    to

    Step 4: Save and test

    Save the file.

    Then test the site from an allowed IP address and from a non-allowed connection. The allowed IP should be able to access the store, while other visitors should still see the maintenance page.

    Cloudflare method to improve Magento 1 maintenance mode

    If using Cloudflare, add the following code to your index.php file instead:

    This helps Magento check the visitor’s original IP address instead of Cloudflare’s IP address.

    Only use this method when Cloudflare is correctly configured for the site. After maintenance, review the temporary code and remove any access that no longer needs to stay in place.

    How to customize the Magento 1 maintenance page

    Magento’s default maintenance page may be too plain for customers. A custom page can give shoppers a clearer message and make the downtime feel more intentional.

    You can customize the Magento 1 maintenance page by editing:

    You can adjust styling here:

    A good maintenance page should include a short message, an expected return time if available, contact information or a support link, and simple brand styling. Keep it clear and brief so customers know the store will be back soon.

    SEO considerations for Magento 1 maintenance mode

    Maintenance mode should be temporary. When possible, the maintenance page should return a 503 Service Unavailable response so search engines understand the downtime is temporary.

    Avoid leaving maintenance mode on longer than needed. After maintenance, confirm that normal pages load again, the maintenance page is gone, and search engines or users are not still seeing a cached maintenance page.

    Pre-maintenance checklist

    Before turning on maintenance mode, confirm the maintenance window, back up the files and database, and make sure you have FTP, SFTP, or SSH access.

    Also confirm the public IPs that need access, back up index.php, test the change in staging before making it on the live site, prepare the custom 503 page if needed, notify internal teams, and prepare rollback steps. If downtime may affect orders, consider notifying customers before the maintenance window.

    Document any temporary IP allowlist changes so they can be removed after maintenance.

    Post-maintenance checklist

    After maintenance, remove maintenance.flag and confirm the store is live again.

    Then revert temporary index.php edits if they are no longer needed, remove temporary IP allowlists, clear Magento cache, clear server or CDN cache, test frontend pages, test admin access, test checkout, test customer login, and check error logs.

    Magento 1 support note

    Magento 1 is no longer the current Magento release line, but some stores still need to maintain existing Magento 1 environments. For those stores, maintenance workflows should be handled carefully with backups, testing, access controls, and reliable hosting support.

    Magento 1 maintenance mode FAQs

    Edit index.php to allow trusted public IP addresses to bypass maintenance mode while other visitors continue seeing the maintenance page.

    Edit the maintenance template at /errors/default/503.phtml and update styling in /errors/default/css/styles.css.

    You may have deleted the file from the wrong directory, or the maintenance page may be cached. Check the Magento root directory, then clear Magento, server, CDN, and browser cache.

    Getting started with Magento 1 maintenance mode

    Magento 1 maintenance mode is controlled by maintenance.flag, but the default setup may block developers as well as customers.

    Start by backing up index.php, confirming the trusted IPs that need access, and updating the maintenance-mode logic so approved users can test the site while customers see the maintenance page.

    Magento 1 maintenance workflows depend on reliable hosting, safe file access, backups, and support. Liquid Web Magento hosting gives store owners the infrastructure and help they need to manage maintenance, updates, and troubleshooting with confidence. Explore Liquid Web Magento hosting to find the right fit.

    Ready to get started?

    Get the fastest, most secure Magento hosting on the market

    Related articles

    Wait! Get exclusive hosting insights

    Subscribe to our newsletter and stay ahead of the competition with expert advice from our hosting pros.

    Loading form…