Custom Maintenance Page Template For WordPress

Print View Mobile View

Here’s a custom maintenance page template code for WordPress that will increase the experience of your site visitors while you’re doing some maintenance work in the backend.
WordPress maintenance template

This page is automatically displayed, replacing the default “Briefly Unavailable for Scheduled Maintenance” message, when WordPress or WordPress plugins are upgrading.

<?php
/* Tell search engines that the site is temporarily unavilable */
$protocol = $_SERVER["SERVER_PROTOCOL"];
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' );
header( 'Retry-After: 600' ); // 10 minutes
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Maintenance Mode | SumTips</title>
	<meta charset="utf-8" />
	<style type='text/css'>
	body {
		font: 16px Georgia, serif;
		line-height: 1.3;
	}
	#content {
		background: #fff url(/wp-content/maintenance.png) no-repeat left top;
		height: 305px;
		width: 375px;
		margin: 120px auto;
		padding: 50px 50px 0 325px;
	}
	h1 {
		font-size: 34px;
		font-weight: normal;
		margin-top: 0;
	}
	p {
		margin: 0 0 10px 5px;
	}
	</style>
</head>
<body>
<div id="content">
	<h1>Maintenance Mode!</h1>
	<p>This site is undergoing a brief bit of maintenance.</p>
	<p>We apologize for the inconvenience, we're doing our best to get things back to working order for you.</p>
</div><!-- #content -->
</body>
</html>
<?php die(); // Pass control back to WordPress upgrade routine ?>

How to Use?

Just create a new file named maintenance.php inside wp-content directory and paste in the above code in it. maintenance.php is kept as an independent file in the WordPress installation, so it’s not affected by core upgrades. [via Aliso]