# How to put WordPress in maintenance mode

> Put WordPress in maintenance mode with core: the .maintenance file, a custom maintenance.php drop-in, fixing a stuck site, and the 503 and Retry-After rules for SEO.

Canonical: https://scaplet.com/seo/wordpress/maintenance-mode

Guide WordPress WordPress · Downtime

Put WordPress in maintenance mode with core: the .maintenance file, a custom maintenance.php drop-in, fixing a stuck site, and the 503 and Retry-After rules for SEO.

6 min

read

9

sources

Oct 21, 2026

updated

Scaplet Editorial Team

author

In one line

WordPress core enters maintenance mode when a `.maintenance` file that sets `$upgrading` to a Unix timestamp exists in the site root, and it counts for 10 minutes. The updater creates and deletes that file during updates. You can brand the page with a `wp-content/maintenance.php` drop-in. For SEO, serve a 503 with Retry-After and never noindex.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fmaintenance-mode%20(%22How%20to%20put%20WordPress%20in%20maintenance%20mode%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fmaintenance-mode%20(%22How%20to%20put%20WordPress%20in%20maintenance%20mode%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fmaintenance-mode%20(%22How%20to%20put%20WordPress%20in%20maintenance%20mode%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fwordpress%2Fmaintenance-mode%20(%22How%20to%20put%20WordPress%20in%20maintenance%20mode%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 6 parts, 6 minutes.

1. [How to put WordPress in maintenance mode 01](#how-to-put-wordpress-in-maintenance-mode)
2. [What visitors and crawlers get 02](#what-visitors-and-crawlers-get)
3. [Add a custom maintenance page 03](#add-a-custom-maintenance-page)
4. [If the site is stuck in maintenance mode 04](#if-the-site-is-stuck-in-maintenance-mode)
5. [What any maintenance mode must do for SEO 05](#what-any-maintenance-mode-must-do-for-seo)
6. [Check it with curl 06](#check-it-with-curl)

_01_How it works

## How to put WordPress in maintenance mode

Core decides whether the site is in maintenance mode by looking for a file named `.maintenance` in the WordPress root. In the core source, `wp_is_maintenance_mode()` returns false if that file does not exist, and otherwise loads it and compares the `$upgrading` timestamp it sets with the current time. Its description says: "If the file was created less than 10 minutes ago, WordPress is in maintenance mode."

1. 1

### Create the .maintenance file

In the same folder as `wp-config.php`, create `.maintenance` with the line below, replacing the number with the current Unix time (`date +%s` prints it on Linux and macOS). The upgrader writes the same format when it starts an update.
2. 2

### Check the site

Load the home page. Visitors get "Briefly unavailable for scheduled maintenance. Check back in a minute." with a 503 status. See the curl check below.
3. 3

### Leave maintenance mode

Delete `.maintenance`, or let the timestamp pass 10 minutes. The check returns false as soon as the file is gone.

The developer reference documents this file as the signal WordPress uses while it updates. Creating it by hand uses the same mechanism for a short window, so test each step on a staging copy first.

.maintenance

```
<?php $upgrading = 1792927329; ?>
```

The timestamp stops counting after 10 minutes. The source treats a timestamp that is 10 minutes old or older as "maintenance over", so a hand-made file covers a short window only. Core documents nothing beyond that window. For longer planned downtime, return the 503 from your web server or host instead, or write a fresh timestamp before the old one expires.

**It also blocks the dashboard** `wp_maintenance()` is called from `wp-settings.php` before the rest of WordPress loads, so the check applies to every request that loads WordPress, not only the front end. Keep SFTP or file manager access ready so you can delete the file.

_02_Core behavior in maintenance mode

## What visitors and crawlers get

Item

### [Status code](/glossary/http-status-codes)

Behavior

503 with the default message, set through `wp_die()`

Source

`wp_maintenance()` source

Item

### Retry-After header

Behavior

`Retry-After: 600` with the default message

Source

`wp_maintenance()` source

Item

### Default message

Behavior

"Briefly unavailable for scheduled maintenance. Check back in a minute."

Source

`wp_maintenance()` source

Item

### Custom page

Behavior

`wp-content/maintenance.php` replaces the default message

Source

`wp_maintenance()` reference

Item

### Duration

Behavior

Until the file is deleted or its timestamp is 10 minutes old

Source

`wp_is_maintenance_mode()` source

Item

### Plugins

Behavior

Not loaded yet, so plugin code cannot change this response

Source

`wp-settings.php` source

_03_Check it

## Add a custom maintenance page

Per the `wp_maintenance()` reference, if a `maintenance.php` file exists in `wp-content`, WordPress loads it instead of the default message. In the current release (7.1.3 at the time of writing) and in the developer reference, that branch requires the file and ends the request without setting a status code or Retry-After, so the drop-in has to send both itself. The 6.9 and 7.0 branches have the same code. WordPress functions such as `status_header()` are not loaded yet at that point, so the drop-in uses plain PHP. The development source for 7.2 (trunk, marked `@since 7.2.0`) adds the 503 status, no-cache and `Retry-After: 600` headers before loading the drop-in. Sending them yourself works in both.

Google advises static HTML, few off-page resources (inline CSS and base-64 images), and clear guidance on the error page, such as the date you expect to be back and how to contact support. Do not add a `noindex` meta tag to the template. The `Retry-After` value above is an example, so set your own best estimate of the duration.

The `enable_maintenance_mode` filter, added in 4.6.0, receives `$enable_checks` and `$upgrading`. Per its description it "is designed for non-web runtimes", and returning false lets the request continue despite maintenance mode.

wp-content/maintenance.php

```
<?php http_response_code( 503 ); header( 'Retry-After: 3600' ); header( 'Content-Type: text/html; charset=utf-8' ); ?> <!doctype html> <html lang="en"> <head><meta charset="utf-8"><title>Back soon</title></head> <body> <h1>We are doing maintenance</h1> <p>We expect to be back by 3 pm UTC. Questions: support@example.com</p> </body> </html>
```

_04_How it works

## If the site is stuck in maintenance mode

A failed or interrupted update can leave `.maintenance` behind. A timestamp that is 10 minutes old or older no longer counts, so the site recovers by itself after that. If the message does not go away, delete the file.

1. 1

### Find the file

Look in the same directory as `wp-config.php`. The name starts with a dot, so turn on hidden files in your SFTP client or file manager.
2. 2

### Delete it

Removing `.maintenance` ends maintenance mode, the same [thing](/glossary/entity) the upgrader does when it finishes.
3. 3

### Retry the update

Run the failed update again from Dashboard > Updates, then confirm the home page returns 200.

If the site still shows the message after the file is gone, look for a `wp-content/maintenance.php` drop-in or a server-level maintenance page, since both can produce their own page.

_05_Worth knowing

## What any maintenance mode must do for SEO

This applies to core, a drop-in, or any plugin or server rule you use. These points come from Google's guidance on pausing a site and its status code documentation.

### Return 503, not 200 or 404

"If you need to urgently disable the site for 1-2 days, then return an informational error page with a `503` HTTP response status code instead of all content."

### Send Retry-After

Google says to use the retry-after HTTP header with a best effort date or duration, and static HTML.

### Keep it short

For a longer closure Google says to provide an [indexable](/glossary/indexability) home page as a placeholder with a 200 status code. It recommends limiting site functionality over disabling the site, and calls disabling not recommended.

### Do not noindex

Google says not to block the website with 403, 404 or 410 status codes, or with a `noindex` [robots meta tag](/glossary/robots-meta-tag) or `x-robots-tag` header, because this will remove the website's URLs from Google Search.

### Leave robots.txt alone

Do not return a 503 for `robots.txt`, because this blocks all crawling, and do not disallow all crawling.

### Expect a slower crawl

5xx and 429 responses make Google temporarily slow down. Already indexed URLs are preserved, but eventually dropped, and content from 5xx responses is ignored. Google raises the crawl rate gradually once 2xx responses return.

Google also warns that its systems cannot refresh titles, descriptions, metadata or [structured data](/glossary/structured-data) on a page that returns a 503.

_06_Check it

## Check it with curl

Google suggests confirming the 503 locally with curl or a similar tool. Run both commands from a machine that is not logged in to WordPress.

The first should show `HTTP/1.1 503 Service Unavailable` (or `HTTP/2 503`) and a `retry-after` header, and should not return 200 or a redirect. The second must not return a 503 per Google. If it does, the maintenance rule is catching `robots.txt` too. For more on those rules see [WordPress robots.txt](/seo/wordpress/robots-txt) and the [5xx server errors](/seo-issues/server-errors-5xx) issue.

Other platforms handle this differently: see [Drupal maintenance mode](/seo/drupal/maintenance-mode), [Laravel maintenance mode](/seo/laravel/maintenance-mode) and the [HTTP 503 error](/errors/http/503).

Terminal

```
curl -I https://example.com/ curl -I https://example.com/robots.txt
```

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ How do I put my WordPress site in maintenance mode?

Create a `.maintenance` file in the site root, next to `wp-config.php`, containing `<?php $upgrading = 1792927329; ?>` with the number replaced by the current Unix time. Core then answers requests with a maintenance message and a 503 status for 10 minutes, or until you delete the file. Core documents the file as the updater's signal, so test it on staging first.

_02_ What status code does WordPress maintenance mode return?

503. With the default message, core sends it through `wp_die()` along with a `Retry-After: 600` header. In the current 7.1 release, a `wp-content/maintenance.php` drop-in must send its own 503 and Retry-After.

_03_ How do I get WordPress out of maintenance mode?

Delete the `.maintenance` file in the site root, or wait until its timestamp is 10 minutes old. The file is hidden, so turn on hidden files in your SFTP client.

_04_ Is maintenance mode bad for SEO?

A short 503 with Retry-After is what Google advises for 1-2 days. Longer closures call for an indexable 200 placeholder, and Google says closing a site even for a few weeks can have negative consequences for indexing. Never use [noindex](/glossary/noindex), 404 or 403 for maintenance.

Sources · 9

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- wordpress.org
- github.com
- google.com

1. 01 [wp_maintenance() | WordPress Developer Resources](https://developer.wordpress.org/reference/functions/wp_maintenance/) developer.wordpress.org · checked 2026-10-25
2. 02 [wp_is_maintenance_mode() | WordPress Developer Resources](https://developer.wordpress.org/reference/functions/wp_is_maintenance_mode/) developer.wordpress.org · checked 2026-10-25
3. 03 [WP_Upgrader::maintenance_mode() | WordPress Developer Resources](https://developer.wordpress.org/reference/classes/wp_upgrader/maintenance_mode/) developer.wordpress.org · checked 2026-10-25
4. 04 [enable_maintenance_mode | WordPress Developer Resources](https://developer.wordpress.org/reference/hooks/enable_maintenance_mode/) developer.wordpress.org · checked 2026-10-25
5. 05 [src/wp-includes/load.php | WordPress/wordpress-develop on GitHub](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/load.php) github.com · checked 2026-10-25
6. 06 [src/wp-includes/load.php, 7.1 branch | WordPress/wordpress-develop on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/load.php) github.com · checked 2026-10-25
7. 07 [src/wp-settings.php | WordPress/wordpress-develop on GitHub](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-settings.php) github.com · checked 2026-10-25
8. 08 [Temporarily pause or disable a website | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/pause-online-business) developers.google.com · checked 2026-10-25
9. 09 [How HTTP status codes affect Google's crawlers | Google Crawling Infrastructure](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-10-25

## Keep learning

[All platform guides](/seo)

[Learn Laravel maintenance mode and SEO Frameworks](/seo/laravel/maintenance-mode) [Related 5xx server errors Status codes and links](/seo-issues/server-errors-5xx) [Read next WordPress SEO CMS](/seo/wordpress) [Do Run a free site audit Free, about two minutes](/site-audit)

More in WordPress SEO
[AMP on WordPress](/seo/wordpress/amp) [Google Analytics on WordPress](/seo/wordpress/google-analytics) [How to put WordPress in maintenance mode](/seo/wordpress/maintenance-mode) [WordPress 404 page](/seo/wordpress/404) [WordPress AI crawlers](/seo/wordpress/ai-crawlers) [WordPress breadcrumbs](/seo/wordpress/breadcrumbs) [WordPress canonical tags](/seo/wordpress/canonical-tags) [WordPress Core Web Vitals](/seo/wordpress/core-web-vitals) [WordPress favicon](/seo/wordpress/favicon) [WordPress Google Search Console setup](/seo/wordpress/search-console) [WordPress hreflang and multilingual SEO](/seo/wordpress/hreflang) [WordPress HTTPS](/seo/wordpress/ssl) [WordPress image SEO](/seo/wordpress/image-seo) [WordPress internal links](/seo/wordpress/internal-links) [WordPress lazy loading](/seo/wordpress/lazy-loading) [WordPress noindex](/seo/wordpress/noindex) [WordPress redirects](/seo/wordpress/redirects) [WordPress robots.txt](/seo/wordpress/robots-txt) [WordPress SEO plugins](/seo/wordpress/seo-plugin) [WordPress SEO titles and meta descriptions](/seo/wordpress/title-and-meta) [WordPress speed optimization](/seo/wordpress/page-speed) [WordPress structured data](/seo/wordpress/structured-data) [WordPress www redirect](/seo/wordpress/www-redirect) [WordPress XML sitemap](/seo/wordpress/xml-sitemap)

Terms on this page
[HTTP status codes](/glossary/http-status-codes) [Entity](/glossary/entity) [Indexability](/glossary/indexability) [Robots meta tag](/glossary/robots-meta-tag) [Structured data](/glossary/structured-data) [Noindex](/glossary/noindex)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
