Get started today!◦ Full contract buyout ◦ Up to $1,000 credit ◦ Free migrations
Chat with us
Home » Magento Guide » Magento Security Guide » Improving Magento 1 Maintenance Mode: Tips and Tricks

Improving Magento 1 Maintenance Mode: Tips and Tricks

Learn how to improve Magento 1 maintenance mode by modifying the index.php file to allow access to a range of IP addresses. Add code to your index.php file to allow you to work on your site.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

How to improve Magento 1 maintenance mode by modifying  the index.php file to allow access to a range of IP addresses. 

Magento 1 maintenance mode allows you to restrict customer access to your store while performing site maintenance. Unfortunately, it also freezes you out of the store. Add the following code to your index.php file to allow you to work on your site while everyone else sees Magento 1 maintenance mode displayed.

 Read Magento 1 vs Magento 2: Should You Stay or Should You Go?

Method to improve Magento 1 maintenance mode

  1. Open index.php. Above line 64, add the following and include the IPs to retain access to the site in the “allowed” array:
    ip = $_SERVER[’REMOTE_ADDR’]; allowed = array(’1.1.1.1’,’2.2.2.2’);
  2. Locate and change the line:
    if (file_exists($maintenanceFile)) { to if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
  3. Save the file. 

Cloudflare method to improve Magento 1 maintenance mode

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

ip = $_SERVER[’HTTP_CF_CONNECTING_IP’]; allowed = array(’1.1.1.1’,’2.2.2.2’);


For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

Ready to get started?

Get the fastest, most secure WordPress.org hosting on the market.

Additional resources

What is managed WordPress hosting? →

Get details and decide if managed WordPress hosting is right for you.

Must-have web development plugins to create WordPress websites at scale →

Explore the best web development plugins to enhance functionality, improve performance, and streamline your WordPress site.

A complete guide to WordPress shortcodes →

Shortcodes make life easier. Learn how to get started!