Forums

How to change message "Error establishing a database connection" (5 posts)

  1. liquidrice
    Member
    Posted 3 months ago #

    Is there a way to change this message to say something else.

    Would be nice to add that the site will be back in a few mins or something.

    " Error establishing a database connection. This website will be back in a few minutes."

  2. dor
    Member
    Posted 3 months ago #

    Somewhere there is a plugin for maintenance mode, if i can remember.

    May be it isn't what you want exactly, but... i guess you can not change php error messages so easy.

  3. whooami
    Member
    Posted 3 months ago #

    Would be nice to add that the site will be back in a few mins or something.

    create the file, this functionality is already available.

    // Load custom DB error template, if present.
    	if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
    		require_once( WP_CONTENT_DIR . '/db-error.php' );
    		die();
    	}

    wp-content/db-error.php <---- assuming you havent changed your content dir.

  4. dor
    Member
    Posted 3 months ago #

    Thank you whooami.

  5. vici
    Member
    Posted 4 weeks ago #

    where is this functionality code placed? I mean in which php file?
    I'm asking because it doesn't work for me even though I placed a file db-error.php in the wp-content directory

Reply

You must log in to post.

About this Topic

Tags