General

How to Set the Maintenance Mode page in Magento 2?

Hello Magento folks,

Welcome to the Magento Tutorial Blog. Today I am here to help you in How to Custom Maintenance mode Page in Magento 2. Also, go through our last published blog How To Hide Add To Cart Button in Magento 2. Let’s get in.

Introduction:

Mainly, all the store owners will choose to hide their maintenance activities from their customers. For many reasons, the customer can feel insecure or might get irritated if they see an under-construction site. So, to overcome this problem the Magento provides an inbuilt feature of making your site into Maintenance mode. Here, in the Maintenance mode, the Magento 2 closes the store for the visitors. Let’s learn How to Custom Maintenance mode Page in Magento 2.

Steps to Custom Maintenance mode Page in Magento 2:

Step 1: Go to the pub/error folder then rename local.xml.sample to local.xml file: 

 <?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */-->
<config>
    <skin>magecomp</skin>  <!-- Add your custom folder name  -->
    <report>
        <!--
            "action" can be set to "print" to show exception on screen and "email"
            to send exception on specified email
        -->
        <action>print</action>
        <!--
            in "subject" you can set subject of email
        -->
        <subject>Store Debug Information</subject>
        <!--
            "email_address" admin email address
        -->
        <email_address></email_address>
        <!--
            "trash" is handle about trace info
            value "leave" is for store on disk
            value "delete" is for cleaning
        -->
        <trash>leave</trash>
    </report>
</config>

Step 2: Now copy the default folder and rename it. Give name magecomp because we add this name on skin tag in local.xml

Step 3: Now go to magecomp folder and open 503.phtml and add your custom code and design to show custom maintenance page

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */?>

<h1>Service Temporarily Unavailable</h1>
<p>
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems.
    Please try again later.      
</p>

Step 4: Refresh the page. 

Final Words:

Hence, after the implementation of the above steps, you will be able to set up a Custom Maintenance mode Page in Magento 2. Make your customer experience better by applying the Custom Maintenance mode Page in your Magento 2 store.

To avoid the above steps, integrate Magento 2 Maintenance Page Extension to painlessly display a user-friendly maintenance page with a countdown-timer.

Tell us at MageComp Support in case of any difficulties in the above solution. Don’t forget to share with your Magento fellas and also share your appropriate reviews in the comment section below.

Happy Coding.

Click to rate this post!
[Total: 21 Average: 3.8]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

View Comments

  • Are these instructions still valid in magento 2.4.5? because in maintenance mode it gives error message 1 exception(s):
    maintenance mode enabled.

Recent Posts

Generating Thumbnails with Spatie Media Library in Laravel 11: A Step-by-Step Guide

Generating image thumbnails is a common requirement in web applications, especially when handling media-heavy content.…

20 hours ago

Enhancing Web Application Security with Laravel’s Built-In Features

In today’s digital landscape, web application security is paramount. As a powerful PHP framework, Laravel…

2 days ago

Magento 2 Extensions Digest October 2024 (New Release & Updates)

October was an exciting month for MageComp! From significant updates across our Magento 2 extension…

2 days ago

Improving Error Handling and Transition Management in Remix with useRouteError and useViewTransitionState

In modern web development, seamless navigation and state management are crucial for delivering a smooth…

1 week ago

Magento Open Source 2.4.8-Beta Release Notes

Magento Open Source 2.4.8 beta version released on October  8, 2024. The latest release of…

2 weeks ago

How to Create Catalog Price Rule in Magento 2 Programmatically?

Hello Magento Friends, Creating catalog price rules programmatically in Magento 2 can be a valuable…

2 weeks ago