Personalize db errors now with Wordpress 2.3.2
Personalizing database down error for Wordpress powered sites was one of the suggestions I offered humbly to the Wordpress team back in August 2007. Happy to note that it’s now in place in the latest Wordpress update (version 2.3.2), as Ryan notes:
As a little bonus, [version] 2.3.2 allows you to define a custom DB error page. Place your custom template at wp-content/db-error.php. If WP has a problem connecting to your database, this page will [be] displayed rather than the default error message.
It is important to note that the custom db error page file is not under the theme folder, but rather in wp-content folder. Also, it is important to avoid using any template tag (in db-error.php)1 that queries the database for stored information; because when the database is down, you cannot get a reply back from the database to show the queried info on the error page. Obvious, but if it wasn’t to you, then you know now.
As always, Wordpress team listens—that’s something I really like about them. It doesn’t matter who you are, your suggestions are always considered. That’s the strength of the community.
- I use plain html/php coded content in my
db-error.phpfile. [←]
