{"id":1756,"date":"2021-05-08T05:29:09","date_gmt":"2021-05-08T05:29:09","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/enable-or-disable-maintenance-mode-in-magento-2\/"},"modified":"2025-07-16T17:53:27","modified_gmt":"2025-07-16T12:23:27","slug":"enable-or-disable-maintenance-mode-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/enable-or-disable-maintenance-mode-in-magento-2\/","title":{"rendered":"How to Enable or Disable Maintenance Mode in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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\u00a0Magento 2\u00a0store?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, it is possible with the feature of maintenance mode.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/configuration-guide\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">Maintenance mode<\/a>&nbsp;is a shortcut to serve a temporary error notification to all visitors of your store and inform them to come back later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It displays the error message as shown below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/04\/Screenshot-at-April-27th-2021-6.22.17-pm-e1619588845777.png\" alt=\"How to Enable or Disable Maintenance Mode in Magento 2\" class=\"wp-image-14660\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Follow the below method to either&nbsp;<em><strong>enable or disable maintenance mode in Magento 2<\/strong><\/em>&nbsp;as per your requirements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Enable or Disable Maintenance Mode in Magento 2<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">Enable The Maintenance Mode in Magento 2<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Using Command :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento maintenance:enable &#91;--ip=&lt;ip address&gt;]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to enable the maintenance mode for particular IP then pass that IP in the above command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">otherwise pass the below command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento maintenance:enable<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Disable The Maintenance Mode in Magento 2<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Using Command :<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For particular IP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento maintenance:disable &#91;--ip=&lt;ip address&gt;]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To disable the maintenance mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento maintenance:disable<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Show Maintenance Status<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use the below command to know the current status of the maintenance mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento maintenance:status<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Exempt IP Addresses From Maintainance Mode<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to allow access to the frontend store from a specific IP address while Magento website is in maintenance mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento maintenance:allow-ips &lt;ip address&gt; .. &lt;ip address&gt; &#91;--none]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The above solution is the quickest and simplest way to enable\/disable maintenance mode in Magento 2 as per the need of the hour.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to share the solution with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1756","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1756"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1756\/revisions"}],"predecessor-version":[{"id":18086,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1756\/revisions\/18086"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}