WordPress database schema

The core is based on 11 database tables:

  1. $wpdb->posts - basic posts, pages and other post types info;
  2. $wpdb->postmeta - extra posts, pages and other post types info;
  3. $wpdb->comments - basic comments info;
  4. $wpdb->commentmeta - extra comments info;
  5. $wpdb->links - links info;
  6. $wpdb->options - options info;
  7. $wpdb->users - basic user info;
  8. $wpdb->usermeta - extra user info;
  9. $wpdb->terms - categories and tags
  10. $wpdb->term_relationships - relationship between posts and categories or tags;
  11. $wpdb->term_taxonomy - relationship for categories or tags;

All table names is the concatination of WordPress table prefix and table name (for example: "wp_posts"). WordPress table prefix ($wpdb->prefix) is "wp_" by default. You can change it in "wp-config.php" if you want to intall more than one WordPress site on the same database.

Working with database in WordPress.

1 thought on “WordPress database schema”

  1. I'm looking for a wordpress database with 3 tables (clubb, member and category) members are linked to clup and category. The user will first input clup information and then member information and last witch categories for the members. A club can have many members and a member can bi in may categoris. Can anyone help med with this problem? hans@lovstrom.com

    Reply

Leave a Reply to Hans Lövström Cancel reply