February 4, 2012

Database structure

WordPressMU creates the following tables upon installation:

wp_1_categories
wp_1_comments
wp_1_link2cat
wp_1_links
wp_1_options
wp_1_post2cat
wp_1_postmeta
wp_1_posts
wp_blogs
wp_blog_versions
wp_registration_log
wp_signups
wp_site
wp_sitecategories
wp_sitemeta
wp_usermeta
wp_users

A quick read will show that all table with the prefix wp_1_ will be associated to the blog with id #1. When a second blog is added to the system, those tables will be called wp_2_ , and so on with each blog created. Yes, 8 tables per blog will be added to the database. There has been some debate about whether the blog-specific table should be in one table, but ultimately it still stores the same amount of data.

This is just one reason why MU is not suited for installation on shared servers. Typically, the MySQL connection setting will be lowered. Also, phpMyAdmin (used to access the database on many shared servers)  has a difficult time dealing with very large database, specifically when doing backups.

Later, we’ll look at each table and what is stored there.

Get 3 for the price of 2 in the Network Home Bundle

Includes 3 ebooks with plugins -
Network Home Pages: aggregate global content, set up sitewide tags, create a huge tags cloud like the one seen on WordPress.com, global footers and menus, setting defaults & more
Custom Registration: sign up on sub sites, multilingual signup pages, stop spam blogs
WP Curator: pick and choose posts from sub sites to feature on the main home page of your network

Network Home Pages, Custom Registration & WP Curator – $35.90 for all three. Purchase

Comments

  1. Akshay Surve says:

    Eagerly awaiting your next post. ;)

  2. gulflee says:

    hi i had install plugins next gen gallery but i want the plugins auto active then i install plugins commander, i did active but but some table that the plugin need didnot add auto-ly how ? tq

  3. Terni says:

    I’ve just found WordPress MU because it seems it’s not much published by WordPress guys themselves.
    Anyway, since I’m an ASP coder, and I don’t know much about PHP, I thank you for this site wich is very precious to us.
    I’ve seen last post is on June, 21 please don’t stop to carry on this blog. It’s awesome idea and I’m confident WPMU will become soon much more popular and so this blog will increase in users very quickly.
    Thanks again

  4. IT Certification says:

    It is really a useful overview that explains how the database structure works. Well described, Thanks.

  5. MUguy says:

    Can you please tell my how to find wp_sitemeta and other tables? I searched all my folders for hours and couldn’t find them!! I need help. please

    • andrea says:

      The tables aren’t in folders – they’re in a database. You will never find them in a folder unless you have root access to the server and go in via ssh.

      What do you have to look at database structure? phpmyadmin?

  6. Sydney says:

    Question about the dbase in WPMU – how many blogs can you have on one single database? When would you consider splitting the dbase or doing a second install? Thanks!

Trackbacks

  1. [...] Database structure is one of the key difference between WP and WPMU, and this post offers an overview of the WPMu database structure quite nicely. With a promise of more discussion to come. [...]

  2. [...] an addendum to this post, there’s a few extra tables in WPMU 1.3, which should officially be released any day [...]

  3. [...] WPMu Tutorials site has two posts about the basic structure of the WPMu database. It is a useful overview that explains how the [...]

  4. [...] WPMu Tutorials site has two posts about the basic structure of the WPMu database. It is a useful overview that explains how the [...]