- Step 1: create a file in the directory: wp-content/db-error.php
- Step 2: now you can insert static html in this newly created template.
Benefit is, if something happens to your database server and you don’t want your visitors to know that database server is down, instead of displaying default WordPress error messages, you can show a page with message “Maintenance Mode” or redirect visitors to some another site or anything more suitable for your site visitors.
Learn about WordPress database object here: Understanding $wpdb