What is difference between blog id and site id?

The going through the mu functions source I come across references to two different ids for sub-blogs – site id and blog ids. In what context is each used?

Related posts

Leave a Reply

2 comments

    • site_id = the ID of the parent site (the domain, eg. wordpress.com)
    • blog_id = the ID of the parent site’s blog(s) (usually sub-domains, eg mary.wordress.com)
  1. In a Multisite install (and also since WordPress 3), you can have a several blogs (identified in the database model by blog_id) within one site (identified in the database model by site_id).

    The thing that I found confusing in this context, though, is that most of WordPress code and documentation will use a terminology that differs from the database model. They refer to a blog using the word site, and to a site using the word network.

    For example, this section of the Codex refers to the Site URL (as defined in the WP_SITEURL constant), which really is the URL of the blog URL in multisite context.