Title: wp_maintenance
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_maintenance()

## In this article

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

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

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Dies with a maintenance message when conditions are met.

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

The default message can be replaced by using a drop-in (maintenance.php in the wp-
content directory).

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

    ```php
    function wp_maintenance() {
    	// Return if maintenance mode is disabled.
    	if ( ! wp_is_maintenance_mode() ) {
    		return;
    	}

    	if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
    		require_once WP_CONTENT_DIR . '/maintenance.php';
    		die();
    	}

    	require_once ABSPATH . WPINC . '/functions.php';
    	wp_load_translations_early();

    	header( 'Retry-After: 600' );

    	wp_die(
    		__( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ),
    		__( 'Maintenance' ),
    		503
    	);
    }
    ```

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

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

| Uses | 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.

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

Attempts an early load of translations.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [wp_die()](https://developer.wordpress.org/reference/functions/wp_die/)`wp-includes/functions.php` |

Kills WordPress execution and displays HTML page with an error message.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/wp_maintenance/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_maintenance/?output_format=md#)

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

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

## User Contributed Notes

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