WordPress Custom Database Error Pages

by John P.

WordPress Custom Error PageIf you’re running WordPress 2.3.2 or later, there is a new feature that allows you to to specify an error page for those times when your Database is not available. This often happens when there is a huge spike of traffic from Digg or some other social networking site, and it leaves visitors staring at an ugly WordPress database error message.

Well, no error page will take the place of having your actual site online, but you can at least try to make things a little better for your visitors, and I thought one way would be to give em’ a few videos to check out while the server was unavailable.

If you are running WordPress and want to create your own custom DB error page, here is all you need to do:

  1. Download this text file: db-error.txt
  2. Rename the document to db-error.php.
  3. Finally, FTP it to your server and place it directly in the /wp-content/ directory.

That’s it! Of course, if you know HTML you can feel free to modify it. I would suggest perhaps providing links to your MySpace, LinkedIn or other Web pages so that you can re-route your traffic to your other sites during an outage.

Now, if you want to see a sample of what you just created, you can check it out here: http://onemansblog.com/wp-content/db-error.php


{ 13 comments… read them below or add one }

1 Mistergin February 21, 2008 at 10:55 am

I like that you plugged in the Youtube player.. that’s a great way to keep folks busy rather than just displaying an error.. I may add this :)

Thanks!

Reply

2 TheDane February 21, 2008 at 11:35 am

Much better than the usual error :)

I like your Youtube Blender too…

Kim:)

Reply

3 Steve Elliott February 21, 2008 at 5:12 pm

Has anyone here managed to hit the mystical front page of Digg? What effect does it have on traffic – are we talking about a few hundred extra visitiors….or is it on a bigger scale than that?

If large scale, then no doubt there will be people who try to exploit it and spoil the content, a bit like stumbles.

Reply

4 Derek Wong February 21, 2008 at 6:48 pm

Oh pretty interesting, I’ll have to do one of these. I just recently had that page come up when my database went down. I did think that it was pretty ugly but considering that I hardly see it, I didn’t think to modify it. Thanks for the idea.

Reply

5 John P. February 21, 2008 at 10:22 pm
6 TheDane February 21, 2008 at 10:28 pm

It is much larger scale, to the point of crashing web servers :)

I think the only one “worse” Slashdot :)

Kim:)

Reply

7 RHB February 22, 2008 at 12:19 am

very interesting, something else very worthwhile for reading OMB.

Reply

8 Kalidasa February 23, 2008 at 11:20 am

Thanks, that’s very helpful. I may even know enough html to change it a little.

Reply

9 Brandon February 25, 2008 at 11:17 am

I’ll check this out, altho I don’t know when the last time I’ve had a DB error on my blogs, at least I’m not getting emailed about them.

Reply

10 Ryan Williams March 1, 2008 at 4:01 pm

Any idea if you can do something about similar errors like the comment posting error? For an example, simply try spamming a WordPress blog with comments (maybe this one). ;)

Reply

11 Mudslide Design March 30, 2011 at 7:33 am

This might be a bit late, but we now have a free plugin that will allow you to create a template for Wordpress error pages, like the comment submit error page.

Reply

12 Jamie January 2, 2009 at 12:28 pm

I saw this error when upgrading to Wordpress 2.7. My host was 1&1. I attached the method to need to follow to solve this problem

http://www.root777.com/wordpress/solution-to-error-500-after-upgrading-to-wordpress-27/

Reply

13 Mudslide Design March 30, 2011 at 7:35 am

forgot to link you to it mudslidedesign.co.uk/blog/theme-able-wordpress-error-pages

Reply

Leave a Comment

Previous post:

Next post: