Free auditStart free
GuideWordPress · Downtime

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.

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 withChatGPTClaudePerplexityGoogleAI Mode
01How 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.

02Core behavior in maintenance mode

What visitors and crawlers get

Item

Status code

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
03Check 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>
04How 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 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.

05Worth 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 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 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 on a page that returns a 503.

06Check 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 and the 5xx server errors issue.

Other platforms handle this differently: see Drupal maintenance mode, Laravel maintenance mode and the HTTP 503 error.

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.

01How 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.

02What 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.

03How 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.

04Is 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, 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. 01wp_maintenance() | WordPress Developer Resourcesdeveloper.wordpress.org · checked 2026-10-25
  2. 02wp_is_maintenance_mode() | WordPress Developer Resourcesdeveloper.wordpress.org · checked 2026-10-25
  3. 03WP_Upgrader::maintenance_mode() | WordPress Developer Resourcesdeveloper.wordpress.org · checked 2026-10-25
  4. 04enable_maintenance_mode | WordPress Developer Resourcesdeveloper.wordpress.org · checked 2026-10-25
  5. 05src/wp-includes/load.php | WordPress/wordpress-develop on GitHubgithub.com · checked 2026-10-25
  6. 06src/wp-includes/load.php, 7.1 branch | WordPress/wordpress-develop on GitHubgithub.com · checked 2026-10-25
  7. 07src/wp-settings.php | WordPress/wordpress-develop on GitHubgithub.com · checked 2026-10-25
  8. 08Temporarily pause or disable a website | Google Search Centraldevelopers.google.com · checked 2026-10-25
  9. 09How HTTP status codes affect Google's crawlers | Google Crawling Infrastructuredevelopers.google.com · checked 2026-10-25
Free · 2 minutes

Tools point. Agencies advise. This one ships.

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

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane