function domain_exists($domain, $path, $site_id = 1) {}

Check whether a blogname is already taken.
Used during the new site registration process to ensure that each blogname is unique.


  • string $domain: The domain to be checked.
  • string $path: The path to be checked.
  • int $site_id: Optional. Relevant only on multi-network installs.

Source code

function domain_exists($domain, $path, $site_id = 1) {

	global $wpdb;

	return $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: