{"id":3992,"date":"2017-01-23T04:01:21","date_gmt":"2017-01-23T09:01:21","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=3992"},"modified":"2021-12-08T13:31:55","modified_gmt":"2021-12-08T18:31:55","slug":"change-database-error-page-wordpress","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/","title":{"rendered":"How to Change the Database Error Page in WordPress"},"content":{"rendered":"\n

WordPress<\/a> 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<\/a> error page.<\/p>\n\n\n\n

WordPress is an open-source<\/a> web application software for developing websites, blogs, and web applications that have had a lot of work put in by the development team and community at large.<\/p>\n\n\n\n

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 server errors.<\/p>\n\n\n\n

WordPress handles this by putting out a simple one-line message is boring, or should we say ugly text printing out the issue. One may argue that the text message through informative can be a security<\/a> risk depending on how you choose to look at it.<\/p>\n\n\n\n

\"Database<\/a><\/figure>\n\n\n\n

Furthermore, it breaks the consistency in the look and feel of your website’s brand which obviously 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.<\/p>\n\n\n\n

Customizing the Database Error Page<\/h2>\n\n\n\n

The first thing is obviously you need to have access to the WordPress directories. Inside the \/wp-content\/<\/em> folder, you need to create or upload a file named “db-error.php<\/strong>“. Whenever WordPress has a database issue and finds that file, It will actually process that file accordingly.<\/p>\n\n\n\n

In that file is where you can customize your HTML<\/a> and CSS<\/a> 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.<\/p>\n\n\n\n

Below is a template that you can use to get started with your customizing the Database error page.<\/p>\n\n\n\n

<?php \/\/ custom WordPress database error page\n\/\/ Tell the browser that there is a bit of a mess on the server\n  header('HTTP\/1.1 503 Service Temporarily Unavailable');\n  header('Status: 503 Service Temporarily Unavailable');\n  header('Retry-After: 600'); \/\/ in seconds = 10 minutes\n\n  \/\/ You can send yourself an email notification\n  mail("your@email.com", "Database Connection Error", "Problem with the database! Come fix me!", "From: My Website's DB");\n  \/\/ Put out the customized friendly template that matches your website\n?>\n\n<!DOCTYPE HTML>\n<html>\n<head>\n<title>Database Connection Error<\/title>\n<style>\n  \/*\n  Any required CSS rules here\n  *\/\n<\/style>\n<\/head>\n<body>\n  State what you going through in a public friendly way.\n<\/body>\n<\/html><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

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…<\/p>\n","protected":false},"author":1,"featured_media":3993,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,17],"tags":[136,170,180,303,424,433,452,543,591,635,636,637,638,651],"yoast_head":"\nThis is How to Custom Fix the Database Error Page in WordPress<\/title>\n<meta name=\"description\" content=\"Read this if you are annoyed of the database error page in WordPress and learn how to make a custom on to replace this default page\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"This is How to Custom Fix the Database Error Page in WordPress\" \/>\n<meta property=\"og:description\" content=\"Read this if you are annoyed of the database error page in WordPress and learn how to make a custom on to replace this default page\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-23T09:01:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-08T18:31:55+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Change the Database Error Page in WordPress\",\"datePublished\":\"2017-01-23T09:01:21+00:00\",\"dateModified\":\"2021-12-08T18:31:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\"},\"wordCount\":350,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg\",\"keywords\":[\"CMS\",\"CSS\",\"Database\",\"HTML\",\"Open Source\",\"Optimization\",\"PHP\",\"Software Design\",\"Tools\",\"Web\",\"Web Applications\",\"Web Design\",\"Web Development\",\"WordPress\"],\"articleSection\":[\"Articles\",\"Guides\",\"Tips\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\",\"url\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\",\"name\":\"This is How to Custom Fix the Database Error Page in WordPress\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg\",\"datePublished\":\"2017-01-23T09:01:21+00:00\",\"dateModified\":\"2021-12-08T18:31:55+00:00\",\"description\":\"Read this if you are annoyed of the database error page in WordPress and learn how to make a custom on to replace this default page\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Database Error Page\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change the Database Error Page in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/twitter.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"This is How to Custom Fix the Database Error Page in WordPress","description":"Read this if you are annoyed of the database error page in WordPress and learn how to make a custom on to replace this default page","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"This is How to Custom Fix the Database Error Page in WordPress","og_description":"Read this if you are annoyed of the database error page in WordPress and learn how to make a custom on to replace this default page","og_url":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2017-01-23T09:01:21+00:00","article_modified_time":"2021-12-08T18:31:55+00:00","og_image":[{"width":1200,"height":630,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Change the Database Error Page in WordPress","datePublished":"2017-01-23T09:01:21+00:00","dateModified":"2021-12-08T18:31:55+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/"},"wordCount":350,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg","keywords":["CMS","CSS","Database","HTML","Open Source","Optimization","PHP","Software Design","Tools","Web","Web Applications","Web Design","Web Development","WordPress"],"articleSection":["Articles","Guides","Tips"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/","url":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/","name":"This is How to Custom Fix the Database Error Page in WordPress","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg","datePublished":"2017-01-23T09:01:21+00:00","dateModified":"2021-12-08T18:31:55+00:00","description":"Read this if you are annoyed of the database error page in WordPress and learn how to make a custom on to replace this default page","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2017\/01\/Database-Error-Page.jpg","width":1200,"height":630,"caption":"Database Error Page"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/change-database-error-page-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Change the Database Error Page in WordPress"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/twitter.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/3992"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=3992"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/3992\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/3993"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=3992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=3992"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=3992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}