Support » Developing with WordPress » Graceful redirect in case of database error

  • Is it possible to have the page redirected to a landing page when the database connection is broken? This would be more presentable, rather than the default WordPress database error page. Any idea if this could be done? Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • whooami



    sure.. its already done actually

    take a look at wp-includes/functions.php

    the last function, dead_db

    you can see what its doing right there. Notice the file it looks for??

    theres your landing page 🙂

    I can’t find any mention of this wonderful function anywere: not on the web, not in my Worpress installations, nowhere.
    Could you please be a little more explicit?





    What is more explicit than saying the file name?


    and saying its the last function.

    Maybe you are not looking in the right version — I typically provide answers using the most recent version as a starting point.

    Create a custom page named db-error.php in /wp-content/.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Graceful redirect in case of database error’ is closed to new replies.