Title: ms_not_installed
Published: April 25, 2014
Last modified: February 24, 2026

---

# ms_not_installed( string $domain, string $path )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Displays a failure message.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#description)󠁿

Used when a blog’s tables do not exist. Checks for a missing $[wpdb](https://developer.wordpress.org/reference/classes/wpdb/)-
>site table as well.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#parameters)󠁿

 `$domain`stringrequired

The requested domain for the error to reference.

`$path`stringrequired

The requested path for the error to reference.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#source)󠁿

    ```php
    function ms_not_installed( $domain, $path ) {
    	global $wpdb;

    	if ( ! is_admin() ) {
    		dead_db();
    	}

    	wp_load_translations_early();

    	$title = __( 'Error establishing a database connection' );

    	$msg   = '<h1>' . $title . '</h1>';
    	$msg  .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
    	$msg  .= ' ' . __( 'If you are the owner of this network please check that your host&#8217;s database server is running properly and all tables are error free.' ) . '</p>';
    	$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );
    	if ( ! $wpdb->get_var( $query ) ) {
    		$msg .= '<p>' . sprintf(
    			/* translators: %s: Table name. */
    			__( '<strong>Database tables are missing.</strong> This means that your host&#8217;s database server is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.' ),
    			'<code>' . $wpdb->site . '</code>'
    		) . '</p>';
    	} else {
    		$msg .= '<p>' . sprintf(
    			/* translators: 1: Site URL, 2: Table name, 3: Database name. */
    			__( '<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?' ),
    			'<code>' . rtrim( $domain . $path, '/' ) . '</code>',
    			'<code>' . $wpdb->blogs . '</code>',
    			'<code>' . DB_NAME . '</code>'
    		) . '</p>';
    	}
    	$msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> ';
    	$msg .= sprintf(
    		/* translators: %s: Documentation URL. */
    		__( 'Read the <a href="%s" target="_blank">Debugging a WordPress Network</a> article. Some of the suggestions there may help you figure out what went wrong.' ),
    		__( 'https://developer.wordpress.org/advanced-administration/debug/debug-network/' )
    	);
    	$msg .= ' ' . __( 'If you are still stuck with this message, then check that your database contains the following tables:' ) . '</p><ul>';
    	foreach ( $wpdb->tables( 'global' ) as $t => $table ) {
    		if ( 'sitecategories' === $t ) {
    			continue;
    		}
    		$msg .= '<li>' . $table . '</li>';
    	}
    	$msg .= '</ul>';

    	wp_die( $msg, $title, array( 'response' => 500 ) );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-load.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/ms-load.php#L466)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/ms-load.php#L466-L512)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#related)󠁿

| Uses | Description | 
| [wpdb::esc_like()](https://developer.wordpress.org/reference/classes/wpdb/esc_like/)`wp-includes/class-wpdb.php` |

First half of escaping for `LIKE` special characters `%` and `_` before preparing for SQL.

  | 
| [wp_load_translations_early()](https://developer.wordpress.org/reference/functions/wp_load_translations_early/)`wp-includes/load.php` |

Attempts an early load of translations.

  | 
| [dead_db()](https://developer.wordpress.org/reference/functions/dead_db/)`wp-includes/functions.php` |

Loads custom DB error or display WordPress DB error.

  | 
| [wpdb::tables()](https://developer.wordpress.org/reference/classes/wpdb/tables/)`wp-includes/class-wpdb.php` |

Returns an array of WordPress tables.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [is_admin()](https://developer.wordpress.org/reference/functions/is_admin/)`wp-includes/load.php` |

Determines whether the current request is for an administrative interface page.

  | 
| [wp_die()](https://developer.wordpress.org/reference/functions/wp_die/)`wp-includes/functions.php` |

Kills WordPress execution and displays HTML page with an error message.

  | 
| [wpdb::get_var()](https://developer.wordpress.org/reference/classes/wpdb/get_var/)`wp-includes/class-wpdb.php` |

Retrieves one value from the database.

  | 
| [wpdb::prepare()](https://developer.wordpress.org/reference/classes/wpdb/prepare/)`wp-includes/class-wpdb.php` |

Prepares a SQL query for safe execution.

  |

[Show 5 more](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/ms_not_installed/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | The `$domain` and `$path` parameters were added. | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fms_not_installed%2F)
before being able to contribute a note or feedback.