Magento 2 Magento 2 Tutorials

How to Enable & Disable Maintenance Mode in Magento 2?

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...Loading...
able & Disable Maintenance Mode in Magento 2

Did you ever come across a temporary caution board on a website mentioning Work in Progress?

These are the ones that are used to notify people about the state of the website. Now, what if you are looking for something like that in your Magento 2 store?

It is an easy task on the Magento 2 store with the help of maintenance mode. 

What is Maintenance Mode?

Maintenance Mode is a shortcut that can be used to serve a temporary error notification to all the visitors from your store and ask them to visit later. The maintenance mode is helpful when you are setting up a new theme, during the configuration of an extension, upgrading to the latest Magento 2 version, implementing customizations, fixing a security flaw. 

Enabling the maintenance mode shows users broken websites for a while. When Magento is in maintenance mode, visitors see maintenance-enabled notification messages on their web browsers in place of the store. 

Authorized IP Addresses can still view the store normally. 

As shown below, an error message is displayed:

Maintenance Mode Magento 2

Now, here are methods to enable or disable maintenance mode in Magento 2.

Enable the Maintenance Mode

Using Command:

php bin/magento maintenance:enable [--ip=<ip address>]

If you are looking to enable the maintenance mode for any particular IP, pass the IP in the above-mentioned command. Using this, you can enable the maintenance mode for two IP addresses. The IP address of the developer who plans to debug your website is probably included in the above command.

Otherwise, pass the below command:

php bin/magento maintenance:enable

Disable the Maintenance Mode

Using Command:

For particular IP:

php bin/magento maintenance:disable [--ip=<ip address>]

To disable the mode overall:

php bin/magento maintenance:disable

Show Maintenance Status

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

php bin/magento maintenance:status

Exempt IP Addresses from Maintenance Mode

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

php bin/magento maintenance:allow-ips <ip address 1> .. <ip address 5> [--none]

There you go!

Here is the quickest possible way to enable and disable maintenance mode on your Magento 2 store. If you face any issue while doing so, feel free to reach us out.

Recommended: How to Enable / Disable Developer Mode in Magento 2?

You may also like
Magento 2 Vs Opencart
Magento 2 Vs OpenCart: The Major Differences
Top 5 Magento Marketplace Extensions to Build Marketplace Store
Top 5 Magento Marketplace Extensions to Build Marketplace Shop

Leave Your Comment

Your Comment*

Your Name*