WordPress is this great piece of software for creating great websites but like many great things, they also leave a lot to be desired when it comes to certain things and one of them is the database error page.
There are some aspects of the application that have not gotten as much attention for one reason or another. One of these is how the application handles database and other A server is a computer application program that responds to requests for information from a client in a client/server relationship system. A typical example is a web server or pushing a web page to a web browser or a web server receiving email and transferring it to an email client. A server can also refer to the actual hardware designed... More errors.
WordPress handles this by putting out a simple one line message in boring, or should we say ugly text printing out the issue. One may argue that the text message though informative can be a security risk depending on how you choose to look at it.
Furthermore it breaks the consistency in the look and feel of your website’s brand which obviously has has a lot of thought and work and put into it. So how do we fix the problem? Well it is quite simple to do as you will below.
Customizing the Database Error Page
The first thing is obviously you need to have access to the WordPress directories. Inside the /wp-content/ folder, you need to create or upload a file named “db-error.php“. Whenever WordPress has a database issue and finds that file, It will actually process that file accordingly.
In that file is where you can customize your HTML and CSS to match your website theme. You can also change the message to something that is more exciting than the default. The other things that would be nice to have in that file is some headers to let your browser know what is going on and probably retry the link and even send out an email to the website administrator to let them know something is a miss.
Below is a template that you can use to get started with your customizing the Database error page.