Title: enable_maintenance_mode
Published: August 16, 2016
Last modified: August 20, 2026

---

# apply_filters( ‘enable_maintenance_mode’, bool $enable_checks, int $upgrading )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#wp--skip-link--target)

Filters whether to enable maintenance mode.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#description)󠁿

This filter runs before it can be used by plugins. It is designed for non-web runtimes.
If this filter returns true, maintenance mode will be active and the request will
end. If false, the request will be allowed to continue processing even if maintenance
mode should be active.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#parameters)󠁿

 `$enable_checks`bool

Whether to enable maintenance mode. Default true.

`$upgrading`int

The timestamp set in the .maintenance file.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#source)󠁿

    ```php
    if ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) {
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/load.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/load.php#L474)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/load.php#L474-L474)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_is_maintenance_mode()](https://developer.wordpress.org/reference/functions/wp_is_maintenance_mode/)`wp-includes/load.php` |

Checks if maintenance mode is enabled.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fenable_maintenance_mode%2F)
before being able to contribute a note or feedback.