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 :
- <title>What the ... ?</title>
- <center><p>Currently upgrading... Check back later !</p></center>
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.
Want to share or tweet this post? Please use this short URL: http://ozh.in/9t