Contact: Web / Voice / Email / Tips
Simple Thoughts Blog - Java and Web Technologies

Simple solutions for complex problems.

 

WordPress Plugin to Make your Blog Temporarily Unavailable for Maintenance

June 16th, 2005 by Angsuman Chakraborty

Overview

This Plugin allows you to make your blog temporarily unavailable to your users (with custom message). It is still accessible by the administrators.

It does one thing and does it well. It belongs to the class of zero-configuration plugins. In other words even your grandmother can use it.

Download

Download and follow the instructions in the next section for installation.

Installation

http://codex.wordpress.org/Managing_plugins#Installing_a_plugin

Note: This Plugin supports one-click-install through WordPress Plugin Manager and is also available from WordPress Plugin DB.

  1. Upload unavailable.php to your wp-content/plugins directory. At this point you are done unless you want to make your site unavailable now. Then read on.
  2. Log in to WordPress.
  3. Click Plugins from the main menu.
  4. Scroll to find the name of the plugin - Site Unavailable, and click Activate whenever you want to make your site unavailable.

Configuration and Usage

Install and activate the plugin as described above. You are done!

Now your site is unavailable to all of your users, till the time you decide to deactivate the plugin.

To reiterate the site will remain unavailable to all your users while this plugin is activated.

The Feeds and Trackback requests will be sent HTTP Code 503 indicating that the Server is Unavailable and they will be asked to retry after an hour (configurable).

Administrators can access the administrative section even while this plugin is activated.

Advanced

You do not need to read this section. The plugin will work fine without any changes at all. However if you are compulsive and feel the urge to tinker then read on.

To change the default message ( This blog is currently undergoing scheduled maintenance. Please try after 60 minutes. Sorry for the inconvenience. ) use the plugin editor to edit the plugin. Change the line where $message is specified to a message of your choice.

You can change the Retry-After hint given to Feed and Trackback requests by changing $retry_after. The value is in minutes. The default is 60 minutes. It also tells the users of the site when to retry again.

This is very useful when you do a scheduled maintenance and you want your users to come back after a fixed time.
Remember this is a hint. It has no bearing with when you make your site actually available ( by deactivating the plugin ).

Deactivate the plugin from the Plugin screen to make the site available again to the world.


Uninstallation

  1. Log in to WordPress.
  2. Click Plugins from the main menu.
  3. Scroll to find the name of the plugin - Site Unavailable, and click Deactivate. This disables the plugin and makes the site available again to all.

You can also delete the unavailable.php file from wp-content/plugins directory for permanent removal.

Cost

This plugin is free. However a linkback will be deeply appreciated. Think of it as a LinkWare.

Comments, feedbacks and suggestions are welcome.


Filed under CMS Software, Headline News, How To, Pro Blogging, Web, WordPress | | RSS 2.0 | Email this Article

You may also like to read

»WordPress Plugins (Free) Developed and Supported by Taragana.Com
»Translator Plugin Pro / Gold 5.0: Multiple Engine Failover Support
»Angsuman's Translator Plugin Pro Compatible With WordPress 2.1
»How To Get Free Copy of Translator Plugin Pro?
»Paid Content Plugin For WordPress New Version - Request for Suggestions
»Translator Plugin Pro Fully Supported On WordPress 2.x, 2.1.x, 2.2.x & 2.3.x (development)
»Translator Plugin Pro Translating Even Admin Pages: Bug or Feature?
»How to keep your WordPress 1.5 Blog Spam Free
»Congratulations WordPress Plugin Contest Winners & Translator Pro Winner
»Twitting Twitter... Again
»WordPress Translator Plugin Update
»Get Insulted - Menu: Biblical or North Korean
»WordPress Template Modification Tips for Non-Programmers - Robustness
»Angsuman's Authenticated WordPress Plugin - Password Protection for Your WordPress Blog
»Angsuman's WordPress Translator Plugin Pro Update

67 Responses to “WordPress Plugin to Make your Blog Temporarily Unavailable for Maintenance”

  1. Kimiko the Furball Says:

    Awesome plugin, thank you. ^^

  2. Carsten Says:

    Nice plugin, thanks! :-) Just wondering if there was anyway to modify it so that the logged in admin (user level 10) would still see the site as normal, but any lower level users/not logged-in users would see the “down for maintenance” message?

    Thanks!

  3. Angsuman Says:

    @Carsten
    I too was thinking about it. One problem I noticed was that certain data structures are not properly initialized when the plugins are included.

    I will soon release the next version with this feature. Keep an eye on this post.

  4. LcF Says:

    great! I want this for a long time!

  5. Lou Says:

    It would be nice to include the header and footer to keep the exsisting look and feel. It was very simple to get this working.
    $message = ”;
    //$message .= ”;
    $message .= ‘This blog is currently undergoing scheduled maintenance. Please try after ‘.$retry_after.’ minutes. Sorry for the inconvenience.’;

    …..

    if(!strstr($_SERVER['PHP_SELF'], ‘feed/’) && !strstr($_SERVER['PHP_SELF'], ‘wp-admin/’)) {
    @ get_header();
    echo $message.’Plugin provided by Taragana‘;
    @ get_footer();
    exit();
    }

    The @ was to supress some error message.

  6. Lou Says:

    that didn’t work properly.

    It would be nice to include the header and footer to keep the exsisting look and feel. It was very simple to get this working.


    // Message to display to the users of the blog
    $message = ”;
    //$message .= ”;
    $message .= ‘This blog is currently undergoing scheduled maintenance. Please try after ‘.$retry_after.’ minutes. Sorry for the inconvenience.’;

    // DO NOT MODIFY BELOW THIS LINE
    if(!strstr($_SERVER['PHP_SELF'], ‘feed/’) && !strstr($_SERVER['PHP_SELF'], ‘wp-admin/’)) {
    @ get_header();
    echo $message.’Plugin provided by Taragana‘;
    @ get_footer();
    exit();
    }

    The @ was to supress some error message. I only tested this with the default theme.

  7. Lou Says:

    i guess even with code tag I cant properly post it.

  8. Angsuman Says:

    @Lou Thanks for the suggestion. You can email me the code at angsuman AT taragana DOT com.

    I will create a new version in a day or two with this and another change as suggested in the comments above.

  9. KosherJava Says:

    I emailed you the link to the code and comments that can be found in a post at http://www.kosherjava.com

  10. Game Dude X » Woah Nelly! Says:

    [...] Site Updates I just updated the site to 1.5.1.3. There was some kind of security flaw or so. So, I’m glad I got that done. In doing that, I got interested into looking for plugins for WordPress and now I installed one. It’s just to help me mangage the site when I do updates. You can read more about it here. [...]

  11. DElyMyth - /dev/null - Plugin WordPress: Unavailable Says:

    [...] Simple Thoughts, WordPress Italy, Blogging Pro. FeedBurner Resyindication Stats: WordPress &nbspWordPress+Plugins &nbspUnavailable &nbspUnavailable+Plugin&nbspWeb+Tools &nbsp No Comments so far Leave a comment Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> [...]

  12. Mundo El_Nene » Sitio No Disponible Says:

    [...] Plugin Site Unavailable | Página Principal [...]

  13. Wolly Weblog » Grosse novità sul Blog Says:

    [...] Sesta , e per ora ultima novità, Blog non disponibile che mi permette di rendere non raggiungibile il Blog quando faccio manutenzione o aggiornamenti , per evitare di segare il database. [...]

  14. Andy Says:

    I activated the plugin to upgrade to 1.5.2 and after the file upgrade ( just changed files) I could no longer login to Admin. The plugin stopped both site and admin access. I had to remove the plugin from the Options table Active Plugins field!
    Just to let you know there may be a problem after 1.5.2….

  15. Woordenaar on WordPress » Plugins I use Says:

    [...] Site Unavailable (the only plugin NOT activated ) [...]

  16. Will Says:

    Still no new version I see. :(

    Yes I am trying to make it so only admin can view the main site and the admin center too when the plugin is on.

  17. Angsuman Chakraborty Says:

    @Andy & Will
    I will look at it today.

  18. Will Says:

    Wow, thanks a ton! :)

  19. Weblog Tools Collection » Wordpress tips for blog maintenance Says:

    [...] If you want to make your Blog temporarily unavailable (scheduled maintenance for example) you have two very simple and efficient ways : a plugin, or a theme. Technorati Tags: blogging plugin tips wordpress wordpress theme   [...]

  20. Aanimo » Blog Archive » Blog Maintenance Says:

    [...] I wish I had known about this when I was working on updating my blog’s theme. Ah well—at least I’ll be able to use it for the next big update test (search bar and page). [...]

  21. The WeBlog of John » Blog Archive » WordPress Language Translator Says:

    [...] You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your ownsite. [...]

  22. Amanita.net » Blog Archive » Quicklinks for 2005-11-22 Says:

    [...] Unavailable for Maintenance Plugin WordPress plugin to make your site appear unavailable (perhaps while you change something). [via weblogtoolscollection] (tags: wordpress) [...]

  23. La brujula verde » Cómo hacer que tu blog no esté disponible temporalmente Says:

    [...] 1. El plugin Site Unavailable, que te permite mostrar un mensaje personalizado en vez de la página de tu blog. [...]

  24. blogpocket 5.0 » Blog Archive » Says:

    [...] [...]

  25. Frank Says:

    Hy, very nice Plugin - i have translate your plugin for german wp-users and i have write a little unavailable site for this plugin.
    i hope, you enjoy this.

    Link to Plugin: http://www.bueltge.de/wp-waertungsmodus-plugin/101/

    With best regards Frank

  26. bueltge.de [by:ltge.de] » Blog Archive » WP - !Waertungsmodus (Plugin) Says:

    [...] Das Basisscript und die Idee stammen von Angsuman Chakraborty. Das vorhandene plugin habe ich dediglich auf meine Bedürfnisse erweitert und für deutsche WP-User optimiert und dokumentiert. [...]

  27. JOSEPH Says:

    Say, don’t want to sound pushy or anything but umm, when is that next update with inclusions on some of those suggestions coming out?

    Thanks for this TEMPORARILY UNAVAILABLE plug-in:

    VERY USEFUL

  28. Blogging Pro China » Blog Archive » WordPress Plugin: Unavailable Says:

    [...]   Unavailable可以使你的站点在插件激活后任何人都访问不到,包括RSS FEED。 访问 site unavailable [...]

  29. WordPress Plugins (Free) Developed and Supported by Taragana.Com -Java and Web Software Blog Says:

    [...] WordPress Plugin to Make your Blog Temporarily Unavailable for Maintenance [...]

  30. insanity- on stage » Herzlich willkommen! Says:

    [...] Site Unavailable [...]

  31. Kamui89 Says:

    Thanks, its a great plugin =)… and works excellent

  32. Mohikan Says:

    nice, and usefull plugin.
    thanx.
    but. i have a problem (same that Andy):
    i cannot login. when i go to login screen, the message its same, that the main site.
    i hvae only one solution: delete the plugin file :S

  33. Sarit Says:

    This is wonderful! Just what I’ve been looking for.

  34. Do Fun It Now » Installed WP plugins Says:

    [...] Site Unavailable 设置站点维护时的显示信息。 [...]

  35. Mike Says:

    Excellent plugin but it does not work with Wordpress 2.02 Shame really. Unfortunately, you cannot even access the admin once the plugin is activated. Any chance you#ll be upgrading it?

  36. Leion Says:

    This plugin worked so long my browser does not log off my admin account. If I do so, I cannot log in again. The site has shut me out too.

    It is good for short mantainance sessions though :)

    Thanks for this plugin.

  37. Angsuman Chakraborty Says:

    Several people have successfully used this plugin and are using even today.
    The problem appears to be specific to your site.

    Unfortunately I do not have much time at the moment to debug and support this issue.

  38. Nicola M. Says:

    This plugin is exactly what i’m looking for, very useful. Thanks :)

  39. yanksonbright Says:


    ke>

  40. brain Says:

    “This plugin worked so long my browser does not log off my admin account. If I do so, I cannot log in again. The site has shut me out too.”

    I’m having the same problem. Using a fresh install of WP too. HOW DO WE LOGIN NOW? http://www.asdasf/wp-login.php returns “under maintenance”!

  41. Angsuman Chakraborty Says:

    You can always delete/rename the plugin file and things will be back to normal.
    I will take a look into this.

  42. Jon Says:

    Hi,
    Site unavailabel works in my site but, there is no message appear and I can see only white screen.

    I can use my admin accout to activate.

    Any idea?

  43. Leion Says:

    Hi
    I have a urgent problem. After activating this plugin, and deactivating it, I find that my site returns a blank page only. I can still get back the offline page when I activate this plugin. There is nothing I can do to get the site to work again. Can you please give me instructions on how to clear this? Thanks in advance.

  44. Angsuman Chakraborty Says:

    Leion,
    I cannot see anyway the plugin is causing this as it is inactivated.
    In any case delete the plugin file from plugins folder. Also delete your cacahe folder under wp-contents.

    Let me know how it goes.

  45. Leion Says:

    It does not work. I am not sure if this has anything to do with the wp-cache plugin..

  46. Angsuman Chakraborty Says:

    wp-cache 2 is the most likely cause. Check that you do not have gzip compression turned on.

    I also faced such problem with Bad behavior plugin.

    But never ever can my plugin :) cause this behavior.

  47. Mattiesworld » Blog Archive » Wordpress upgrade Says:

    [...] To keep my blog in a solid state while upgrading, I installed a site-unavailable plugin. Worked OK. [...]

  48. Stephen Says:

    Hmmm… I seem to be having the same problem as #36.. I’m hurt, is there a way that I can temporarily disable the plugin from the outside — by FTP maybe? Thanks…

    -Stepn

  49. Angsuman Chakraborty Says:

    > is there a way that I can temporarily disable the plugin from the outside — by FTP maybe?

    Yes, delete the plugin file using http://FTP.

  50. Angsuman Chakraborty Says:

    A new version is coming soon.

  51. Steve Says:

    Angsuman - take a look at the maintenance mode plugin for your next update. Including an admin option page where you can add your own html to generate your own ‘down for the count’ page would be a useful addition

  52. Happy Father’s Day! at Krazy Kory Says:

    [...] Well they waiting will be over tomorrow. I have about 200 pix to upload, and yeah for dial up users that’s going to suck to load all the pictures, for me it’s going to suck to add them all, but oh well I’ll get ‘em done. Anyway, a quick happy fathers day to all! I’m doing ok, big update tomorrow. Site News Our server is having mysql problems again… Kinda sucks if the thing goes down you get that ugly wordpress error thing, when I’m done with the site you’d get an error if mysql goes down but it will have news that I can update as to wut is happening. Also I’ve added a nice plugin where I can do work on the site and if anyone trys to access anypage it will give them an under construction sign. Check out the plugin for wordpress here. Unavailable [...]

  53. Standing Tall » WPのプラグイン:Site Unavailable Says:

    [...] ダウンロード: Site Unavailable - Simple Thoughts [...]

  54. shima Says:

    pls send me new yahoo masinger

  55. zoza Says:

    but you can simply change (replace) index.php page with your Unavailable text

  56. Rolando Says:

    very cool, thank you!

  57. corpodibacco Says:

    Hi. Problem:
    I find ‘php_self’ occasionally not to work with WP installations with a custom path and custom permalinks. This is a problem with many plugins actually.
    I suggest these changes to your code:
    use ‘request_uri’ instead of ‘php_self’, and use ’strpos’ instead of ’strstr’.
    what do you think?

  58. David Says:

    This plugin is great. It works fantastic

  59. Mr Henree Says:

    wow, nice plugin. It makes all wordpress users to next level - profesional.

  60. Manele Says:

    i have some problems with google bots many times when i was working on my blog but with this plugin everything is great! thank you!

  61. houserocker Says:

    thanks for this great and very easy to use plugin!!

  62. FOXSMITH Says:

    Thanks, is very simple

  63. Manele gratis Says:

    is great! and this website is great ! thanks again.

  64. 3gp Says:

    very useful plugin , y put this to my blog and work 100% , IS GREAT MAN !

  65. Paypal Says:

    Great, just what i was looking for! Thanks mate!

  66. manele noi Says:

    I will forward this to all of my friends.

  67. Airdave Says:

    Plugin denies access to google and search engines?

  68. Angsuman Chakraborty Says:

    No. It doesn’t deny access to search engines. However they will see the maintenance page like any other user. This plugin should only be activated when you want to take your blog offline / in maintenance mode.

  69. Prasannah Says:

    Can I enable PHP in that page? I am planning on using a countdown page (that has Flash and PHP for a mailing list) to launch my website. It will be the only page accessible till I launch my website.

Looking forward to hear your thoughts.



Please enter the code shown below ( to verify that you are human ) before you click Submit Comment.

No. 1 method to ethically increase your blog traffic and reach.

Translate

Translate to EnglishÜbersetzen Sie zum Deutsch/GermanPřeložit do Čech/CzechOversætte hen til Dansk/DanishKääntää jotta Finnish/FinnishLefordít -hoz Magyar/HungarianÞýða til Íslenska/IcelandicTraducir a Latinoamericano Español/Latin American Spanishtagapagsalin sa Filipino/FilipinoTłumaczyć wobec Polski/PolishA traduce la spre Român/RomanianPrevesti za Srpski/Serbiantolmačiti v slovenski/SlovenianÖversätta till Svensk/SwedishChyfieitha at Cymraeg/Welshtercüme etmek -e doğru Türk/TurkishPrevesti to Hrvatski/CroatianПревеждам към Българин/BulgarianTraduzca al Español/SpanishTraduisez au Français/FrenchTraduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplifiedترجمة الى العربية/ArabicVertaal aan het Nederlands/DutchΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/Norwegian中文翻译/Chinese TraditionalTraduzir a Língua portuguesa brasileira/Brazilian PortugueseReddo ut Latin/Latin

Taragana Network

»Ctrl-S
»Enterprise Blog
»Free Book on Eye Care by Natural Therapy
»Health Care Blog
»Hot Computer Jobs Blog
»Pet Care & Grooming News and Tips
»Phil Law Blog
»Taragana - Software Outsourcing
»The Angsuman Chakraborty Blog
»The Diabetes Cure Blog
»The Eye Treatment Blog
»The Stem Cell Blog
»Weblog Hosting Blog
"A man's ethical behavior should be based effectually on sympathy, education, and social ties; no religious basis is necessary. Man would indeeded be in a poor way if he had to be restrained by fear of punishment and hope of reward after death." - Albert Einstein