Wordpress Maintenace Notice

October 22, 2009 by nichive · Leave a Comment
Filed under: How-To 

When you work on your wordpress blog, for example modify the theme or back-up your database, would you prefer to suspend the blog while you perform the task? Or do you prefer to act careless and let others see that uncompleted job of yours?

I’d prefer to suspend the blog. Why? Because it’s a nuisance for me, when I’m backing-up my database, somebody posted a comment, which will absolutely be left out from my database back-up. So I think giving a notice to visitors that the blog is under maintenance, and really suspend the blog from outer-side interaction, is a good step.

These following steps will suspend the wordpress blog, by showing a notice on every requested permalink. Its so simple, no plugins required. And it is much better instead of only putting a single emptied index.php file in your blog folder (because when people access the permalink, the content will still be available).

  1. Access you wordpress root folder (either your domain root folder, or the folder where the blog is being installed). If you can find wp-config.php and wp-settings.php on that path, then you are at the right place.
  2. Create a .maintenance file (note that it’s a dot file, just like .htaccess) – yes it’s a hidden-file. And this is what you type inside of it:
    <?php $upgrading = time(); ?>

This will let your wordpress to display the notice until the current time is less than 10 minutes from the specified by the $upgrading variable. And since the variable is set with the current time itself, then the display will shows as long as the .maintenance file exists.

It’s just that simple, and wordpress will show its default maintenance notice for every page that is requested.

Share and Enjoy:
  • Google Bookmarks
  • Digg
  • del.icio.us
  • StumbleUpon
  • Yahoo! Buzz
  • Technorati
  • Facebook
  • Mixx
  • Live
  • Reddit

Related posts:

  1. Full Size Image in Wordpress Default Gallery
  2. How to Install Wordpress Plugins

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


:smile: :tongue: :unsure: :squint: :glasses: :gasp: :wink: :kiki: more »