Quick Online Tips
Home     About     Popular     Photoblog     Themes     Advertise     Shop     Jobs     Contact

Create Custom Wordpress Database Error Pages

December 30th, 2007
ADVERTISEMENTS

The urgent Wordpress 2.3.2 security release enables you to create a custom wordpress database error page, which will be displayed when wordpress has a problem connecting to your database, instead of garbled php coded error messages.

You need to Create a db-error.php file in any text editor like Notepad, fill in the appropriate html code and place it in the wp-content directory such that its location will be wp-content/db-error.php.

Now whenever you are upgrading wordpress and this file lies in wp-content folder (which is untouched during wordpress upgrades), you can display any custom message you want informing your visitors about the issue and they can check back soon. It is also useful at times when your web hosting provider is having database errors on their server and your wordpress is unable to connect to the database.

db-error.php file

I checked that the latest version 2.3.2 does not have this file installed in wp-content by default. So you need to create it and place it there. Here is the simplest code you can cut and paste in a blank Notepad file and save as db-error.php and FTP it under under wp-content

<html>
<head>
<title>Database Error Page</title>
</head>
<body>
The blog is unavailable due wordpress database connection issues. Please check back soon.
</body>
</html>

You can make it look more professional by blending with your CSS file, add your blog logo, RSS feed link, independent html pages (not connected to the database), sitemeter site traffic tracker and so on… a much appreciated feature.

RSS Subscribe RSS feed     Bookmark and Share



One Response to “Create Custom Wordpress Database Error Pages”

  1. I have created a db-error.php page by browsing to my 404 page, viewing the source file in the browser and saving this one as db-error.php.
    Then I have edited the file to show the right message and deleted some of the content.
    Now it looks very similar to a normal page.

Leave a Reply

  • Subscribe free daily email newsletter Why?
  • RSS   Feed readers   Add to Google Reader or Homepage   Twitter
writeWrite a guest article - Showcase your site to our active community of bloggers, technology experts, and geeks. Now read 100+ guest articles
Jobs
Jobs on SEO | Blogging | SEM | Marketing | Software | More...
Jobs in Google | Yahoo | Microsoft | Adobe | Ebay | Cisco | Intel
Post a job - only $50 for 30 days! | 8 more reasons

Must Buy Software