• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Content Modeling for WordPress
    • WordPress Hidden Gems
    • Web Design
  • Work
    • Presentations and Interviews
    • on GitHub →
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • WordPress Plugins

Stephanie Leary

Writer, Front End Developer, former WordPress consultant

  • About
    • Press Kit
    • Presentations and Interviews
  • Contact Me

WordPress Hidden Gems: Maintenance Mode Message

September 24, 2010 Stephanie Leary 2 Comments

Yesterday, you saw [link id=”6287″]how to customize your database error message[/link]. You can also customize your maintenance mode file, maintenance.php. This is also located in your wp-content directory and is shown to your visitors while you’re upgrading WordPress core files or plugins. Note that it’s a hidden file on UNIX-based operating systems, so you might have trouble seeing it in some applications unless you turn on the option to view hidden files (if there is one).

Here’s a simple example:

<?php
$protocol = $_SERVER&#91;"SERVER_PROTOCOL"&#93;;
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
        $protocol = 'HTTP/1.0';
header("$protocol 503 Service Unavailable", true, 503 );
header('Content-Type: text/html; charset=utf-8' );
?>
<html>
<head>
<title>Down for Maintenance | MySite.com</title>
</head>
<body>
<h1>Down for Maintenance</h1>
<p>This site is temporarily unavailable due to scheduled maintenance. Please try again later.</p>
</body>
</html>
<?php die(); ?>

Of course, you can dress this up with links to your theme’s stylesheet and any images you’d like to include; just remember to use the direct paths to the files rather than relying on bloginfo() paths.

Find all the WordPress Hidden Gems in [link id=”2675″]Beginning WordPress 3[/link].

WordPress

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Reader Interactions

Comments

  1. Andrew Nacin says

    September 24, 2010 at 11:38 pm

    “Note that it’s a hidden file on UNIX-based operating systems, so you might have trouble seeing it in some applications unless you turn on the option to view hidden files (if there is one).”

    Are you referring to the .maintenance file? That’s what triggers the maintenance message.

    Reply
    • Brandon says

      March 14, 2011 at 11:52 am

      Andrew,

      No, the .maintenance file is a temp file that’s generated from the maintenance.php file. If you were to somehow edit that (which I doubt you can), it would be deleted anyway once the updates are complete. Performing another update would simply create a new temp file.

      In this case, you would have to update the maintenance.php file only.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer

My Books

I’m a front end developer at Equinox OLI, working on open source library software. I was previously a freelance WordPress developer in higher education. You can get in touch here or on LinkedIn.

Copyright © 2025 Stephanie Leary · Contact