---
title: "In Magento 2: How to Customize Maintenance Default Page when Maintenance Mode is Active?"
url: "https://magecomp.com/blog/customize-maintenance-default-page-magento-2/"
date: "2022-05-13T12:25:33+00:00"
modified: "2025-02-19T05:55:11+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 527
reading_time: "3 min read"
summary: "Hello Magento Friends,"
description: "The default maintenance page creates a bad user experience. Hence, modify the maintenance page to make it more instructive. Learn more"
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Magento 2 Migration SEO Checklist 2026"
    url: "https://magecomp.com/blog/magento-2-migration-seo-checklist/"
  - title: "Magento 2: How to Add Frontend Product URL Column to Admin Product Grid"
    url: "https://magecomp.com/blog/magento-2-add-frontend-product-url-column-admin-product-grid/"
  - title: "How to Submit Contact Us Data using GraphQL API in Magento 2"
    url: "https://magecomp.com/blog/submit-contact-us-data-using-graphql-api-magento-2/"
---

# In Magento 2: How to Customize Maintenance Default Page when Maintenance Mode is Active?

_Published: May 13, 2022_  
_Author: Dhiren Vasoya_  

![](https://magecomp.com/blog/wp-content/uploads/2022/05/How-to-Customize-Maintenance-Default-Page-when-Maintenance-Mode-is-Active-in-Magento-2-1024x512.webp)

**Hello Magento Friends,**

Today I am going to help you make your Magento 2 maintenance page informative and user-friendly.
[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-4.webp)](https://magecomp.com/services/hire-magento-programmer/)

You can customize the default maintenance page when your Magento 2 site is under maintenance. Show [**user-friendly maintenance page**](https://magecomp.com/magento-2-maintenance-page.html) with countdown timer.
When you put your site in maintenance then Magento shows a default maintenance message as an error, exception, logs or reports, etc. This does not seem amiable to customers. Hence, making Magento’s default maintenance message user-friendly is a good idea.
## Steps to Customize Maintenance Default Page in Magento 2:
**Step 1:** Navigate to the Magento root directory and run the below command from the terminal for enabling maintenance mode in Magento.
```
php bin/magento maintenance:enable
```

**Step 2:** After enabling maintenance mode your homepage looks like the below if developer mode is set to your Magento
[![default maintenance page](https://magecomp.com/blog/wp-content/uploads/2022/05/default-maintenance-page.png)](https://magecomp.com/blog/wp-content/uploads/2022/05/default-maintenance-page.png)

For default and production mode, it shows as an error log or as a report message. This creates a bad user experience so you need to customize the page.
**Step 3:** Now to customize the Magento default maintenance page, **open the .htaccess file from the Magento root directory.**

**Note:** if you are using **Magento version 2.4.x**, then you need to **open the .htaccess file from the pub directory of Magento.**

**Step 4:** Then, find this code from .htaccess file: **“DirectoryIndex index.php”**, Now modify this code to **“DirectoryIndex maintenance.html”**.
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-4.webp)](https://magecomp.com/magento-malware-removal.html)

**Step 5:** Create a **maintenance.html** file on your Magento root directory.
**Note:** If you are using Magento version 2.4.x, then you need to Create a maintenance.html file under the pub directory of Magento.
Now add the below code
```
<!doctype html>
<html>
  <head>
    <title>Site Maintenance</title>
    <meta charset="utf-8"/>
    <meta name="robots" content="noindex"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
      body { text-align: center; padding: 20px; font: 20px Helvetica, sans-serif; color: #333; }
      @media (min-width: 768px){
        body{ padding-top: 150px; }
      }
      h1 { font-size: 50px; }
      article { display: block; text-align: left; max-width: 650px; margin: 0 auto; }
      a { color: #dc8100; text-decoration: none; }
      a:hover { color: #333; text-decoration: none; }
    </style>
  </head>
  <body>
            <h1>We&rsquo;ll be back soon!</h1>
                    <p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. If you need to you can always contact us, otherwise we&rsquo;ll be back online shortly!</p>
            <p>&mdash; The Team</p>
              </body>
</html>
```

You Can modify the above code as per your requirement.
**Step 6:** Now open the Magento home page, your Magento default maintenance page has been changed
[![custom maintenance page](https://magecomp.com/blog/wp-content/uploads/2022/05/custom-maintenance-page.png)](https://magecomp.com/blog/wp-content/uploads/2022/05/custom-maintenance-page.png)

## Conclusion:
Hence, this way you can change the default message of the maintenance page of your Magento 2 store. Check out [**another way to Customize the Maintenance Page in Magento 2**](https://magecomp.com/blog/custom-maintenance-mode-page-magento-2/).
Alternatively, you can use Maintenance Page Extension for Magento 2 to make it more attractive and informative. Check [**How to Integrate Maintenance Page Extension for Magento 2**](https://magecomp.com/blog/magecomp-maintenance-page-magento-2/#Steps_to_Integrate_Maintenance_Page_Extension_for_Magento_2).
[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2023/10/Magento-2-Speed-Performance-Optimization-Services-CTA-4.webp)](https://magecomp.com/magento-performance-optimization.html)

In case you face any difficulty in the above steps, you can contact me via the comment section.
**Happy Coding!**

</body></html>


---

_View the original post at: [https://magecomp.com/blog/customize-maintenance-default-page-magento-2/](https://magecomp.com/blog/customize-maintenance-default-page-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-09-29 13:13:02 UTC_  
