get_blog_id_from_url


get_blog_id_from_url ( $domain, $path = '/' )

Parameters:
  • (string) $domain
  • (string) $path Optional. Not required for subdomain installations.
Returns:
  • (int) 0 if no blog found, otherwise the ID of the matching blog
Defined at:
Change Log:
  • M: U

Description

Get a blog's numeric ID from its URL.

On a subdirectory installation like example.com/blog1/, $domain will be the root 'example.com' and $path the subdirectory '/blog1/'. With subdomains like blog1.example.com, $domain is 'blog1.example.com' and $path is '/'.

Related Functions

get_bloginfo_rss, get_blogs_of_user, get_bloginfo, get_id_from_blogname, get_user_id_from_string

Top Google Results

User discussions

wpseek mobile