solutionweb

WordPress Common Errors and Solutions

Customize WordPress database connection error page

Webmasters who have played WordPress should be familiar with the phrase “Error establishing a database connection”. When you see this sentence, the website may have been hung up for several hours-because WordPress will not automatically email you this error.

Fortunately, WordPress allows us to create a custom database error page, and we only need to create a db-error.php file in wp-content.

Benefits of customization
In this custom error page, we can do these three things:

Tell the search engine that this is just a temporary error;
Send an email to inform the webmaster;
Optimize page information, not just an ugly sentence;
Sample code





< title > the website is temporarily unavailable < /title >


< h1 > the website is temporarily unavailable < /h1 >
< p > the website is under maintenance, please visit later.


< p > contact the webmaster: < a href = "mailto: webmaster @ example.com" > webmaster @ example.com



If you are lazy …
If you are too lazy to do it yourself, you can also install the DB Error Customizer plug-in, which also provides the functions of email notification and custom page content.

Back to top