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

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

17 hours ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

3 days ago

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

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

3 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

4 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

5 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

7 days ago