WordPress Maintenace Notice

October 22, 2009 by · 1 Comment
Filed under: How-To 

When you work on your 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 , 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 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 .) – 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 .maintenancefile exists.It’s just that simple, and wordpress will show its default maintenance notice for every page that is requested.

Be Sociable, Share!

Related posts:

  1. Custom WordPress Maintenance Note
  2. Full Size Image in WordPress Default Gallery
  3. How to Install WordPress Plugins
  4. Create WordPress Post Thumbnail
  5. Solving Incoming Links Widget Problem in WordPress