WordPress tip of the day : how to momentarily turn your WordPress blog down, while working on some heavy maintaining task ?
There are a few plugins around that, once activated, redirect every request to a page telling readers that your blog is currently under some maintenance, reconstruction, attack or anythnig. There is a much much smarter and simple way to do this :
Create a one page theme, index.php only, with your announcement. This file could look like :
- <html>
- <head>
- <title>What the ... ?</title>
- </head>
- <body>
- <center><p>Currently upgrading... Check back later !</p></center>
- </body>
- </html>
You also need a simple style.css so that WordPress will actually identify your file as a theme, and allow you to select it in the admin menu :
- /*
- Theme Name: Shutdown
- Theme URI: http://127.0.0.1/
- Description: Momentarily shut your blog down
- Version: 1
- Author: You
- Author URI: http://localhost/
- */
And you're done. If you select this theme, all of your pages will be available (no "page not found" or anything)and all show the same message.
Of course, for longer shutdowns, you could improve the page a bit : add an appropriate header code (307 Temporary Redirect maybe ?) and a few relevant meta tags so that search engine bots would not completely clear your page out of their database.
I think this method is better than using a plugin since, with such a theme, server and database loads are lowered down to the strict minimum. This could even help you upgrade stuff faster.
I've found this neat trick on WordPress-FR and it's clearly smart stuff.
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/9t
[…] 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 […]
Thanks for the info on turning down the blog – its much easier this way. is this from wordpress, or a workaround ?
This is some great information for WordPress Users. I work on Blogger and it's quite frustrating for me, when someone comes to my site to see everything all messed up. I wish that I could find some way to do what you do with WordPress.