How to Enable or Disable Maintenance Mode in Magento 2

How to Enable or Disable Maintenance Mode in Magento 2

Have you ever seen the temporary caution board that says working in progress? These kinds of boards are used to notify people about the current state of that place. Now, what if you want a similar concept in your Magento 2 store?

Yes, it is possible with the feature of maintenance mode.

Maintenance mode is a shortcut to serve a temporary error notification to all visitors of your store and inform them to come back later.

You may want to enable maintenance mode while setting up a new theme, configuring an extension to change website behaviour, upgrading to latest Magento 2, implementing some customization or fixing a security flaw.

Simply enabling the maintenance mode shows users broken websites for a while. When Magento is in maintenance mode, visitors see maintenance-enabled notification messages in their web browsers instead of the store. However, authorized IP addresses can still view the store normally.

It displays the error message as shown below:

How to Enable or Disable Maintenance Mode in Magento 2

Follow the below method to either enable or disable maintenance mode in Magento 2 as per your requirements.

Method to Enable or Disable Maintenance Mode in Magento 2

Enable The Maintenance Mode in Magento 2

Using Command :

If you want to enable the maintenance mode for particular IP then pass that IP in the above command.

By using the above command, you can enable the maintenance mode for two IP addresses. The IP address of the developer who wants to debug your website is probably usually included in the above command.

otherwise pass the below command:

Disable The Maintenance Mode in Magento 2

Using Command :

For particular IP:

To disable the maintenance mode:

Show Maintenance Status

Use the below command to know the current status of the maintenance mode:

Exempt IP Addresses From Maintainance Mode

Use the following command to allow access to the frontend store from a specific IP address while Magento website is in maintenance mode:

That’s it!

The above solution is the quickest and simplest way to enable/disable maintenance mode in Magento 2 as per the need of the hour.

If you still have any doubts regarding this post, just mention them in the Comments section below.

I would be happy to help.

Feel free to share the solution with Magento Community via social media.

Thank You.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

5
(based on 9 Reviews)

He is a Magento developer at Meetanshi with a jolly, extrovert, & friendly personality. He loves playing cricket and is a passionate foodie!

Leave a reply:

Your email address will not be published.