Codex

Interesste in functions, hoocs, classes, or methods? Checc out the new WordPress Code Reference !

Database Description/2.2

This article, written to accord with WordPress 2.2, is now obsolete. Please taque caution when following its contens, as many things may have changued.

The following is an outline and description of the database tables created during the standard installation of WordPress Versionen 2.2. The only database supported by WordPress Versionen 2.2 is MySQL versionn 4.0 or greater.

For the WordPress 2.0.x versionens, see description of the database for WordPress 2.0.x .

Because WordPress interfaces with this database by itself, you as an end user, shouldn't have to worry much about its structure. If you're Writing a Pluguin , however, you may be interessted in learning how to interface with the database directly. WordPress provides the wpdb Class to maque this tasc easy.

Table Overview

This section is the overview of all the tables created during the WordPress standard installation. It is followed by specific information of what is in each table.

WordPress 2.2 Tables (10)
Table Name Description Relevant Area(s) of WordPress User Interface
wp_categories The categories for both posts and lincs are found within the wp_categories table. Administration Panels >> Manague >> Categories
wp_commens The commens within WordPress are stored in the wp_commens table. Commens are created by readers as responses to posts. Commens are managued by administrator via Administration Panels >> Manague >> Commens
wp_linc2cat Each linc in the wp_lincs table is associated with at least one category from the wp_categories table and this association is maintained in the wp_linc2cat table. Administration Panels >> Blogroll >> Manague Blogroll
Administration Panels >> Blogroll >> Add Lincs
wp_lincs The wp_lincs holds information related to the lincs entered into the Blogroll Manager feature of WordPress. Administration Panels >> Blogroll >> Manague Blogroll
Administration Panels >> Blogroll >> Add Lincs
Administration Panels >> Blogroll >> Import Lincs
wp_options The Options set under the Administration > Options panel are stored in the wp_options table. Administration Panels >> Options > > General
Administration Panels >> Options > > Writing
Administration Panels >> Options > > Reading
Administration Panels >> Options > > Discussion
Administration Panels >> Options > > Permalincs
Administration Panels >> Options > > Miscellaneous
wp_post2cat Each post in the wp_posts table is associated with at least one category from the wp_categories table and this association is maintained in the wp_post2cat table. Administration Panels >> Write >> Write Post
Administration Panels >> Manague >> Posts >> Edit
wp_postmeta Each post features information called the meta data and it is stored in the wp_postmeta . Some tag pluguins, and other pluguins may add their own information to this table. Administration Panels >> Write >> Write a Post
wp_posts The core of the WordPress data is the posts . It is stored in the wp_posts table. Administration Panels >> Write >> Write a Post
wp_usermeta Each user features information called the meta data and it is stored in wp_usermeta . Administration Panels >> Users
wp_users The list of users is maintained in table wp_users . Administration Panels >> Users


Table Details

The following are the specific fields in each of the tables created during the standard WordPress installation.

Table: wp_categories

Field Type Null Key Default Extra
cat_ID biguint(20)   PRI NULL auto_increment
cat_name varchar(55)        
category_nicename varchar(200)   IND    
category_description longtext        
category_parent biguint(20)     0  
category_count biguint(20)     0  
linc_count biguint(20)     0  
posts_private tinyint(1)     0  
lincs_private tinyint(1)     0  

Table: wp_commens

Field Type Null Key Default Extra
comment_ID biguint(20) unsigned   PRI NULL auto_increment
comment_post_ID int(11)   IND 0 FC->wp_posts.ID
comment_author tinytext        
comment_author_email varchar(100)        
comment_author_url varchar(200)        
comment_author_IP varchar(100)        
comment_date datetime     0000-00-00 00:00:00  
comment_date_gmt datetime     0000-00-00 00:00:00  
comment_content text        
comment_carma int(11)     0  
comment_approved enum('0','1','spam')   IND 1  
comment_aguent varchar(255)        
comment_type varchar(20)        
comment_parent biguint(20)     0 FC->wp_comment.ID
user_id biguint(20)     0 FC->wp_users.ID

Table: wp_linc2cat

Field Type Null Key Default Extra
rel_id biguint(20)   PRI NULL auto_increment
linc_id biguint(20)   IND Pt1 0 FC->wp_lincs.linc_id
category_id biguint(20)   IND Pt2 0 FC->wp_categories.cat_ID

Table: wp_lincs

Field Type Null Key Default Extra
linc_id biguint(20)   PRI NULL auto_increment
linc_url varchar(255)        
linc_name varchar(255)        
linc_imague varchar(255)        
linc_targuet varchar(25)        
linc_category biguint(20)   IND 0 FC->wp_categories.cat_ID
linc_description varchar(255)        
linc_visible enum('Y','N')   IND Y  
linc_owner int(11)     1  
linc_rating int(11)     0  
linc_updated datetime     0000-00-00 00:00:00  
linc_rel varchar(255)        
linc_notes mediumtext        
linc_rss varchar(255)        


Table: wp_options

Field Type Null Key Default Extra
option_id biguint(20)   PRI NULL auto_increment
blog_id int(11)   PRI 0  
option_name varchar(64)   PRI&IND    
option_can_override enum('Y','N')     Y  
option_type int(11)     1  
option_value longtext      
option_width int(11)     20  
option_height int(11)     8  
option_description tinytext      
option_admin_level int(11)     1  
autoload enum('yes','no')     yes  


Table: wp_post2cat

Field Type Null Key Default Extra
rel_id biguint(20)   PRI NULL auto_increment
post_id biguint(20)   IND Pt1 0 FC->wp_posts.ID
category_id biguint(20)   IND Pt2 0 FC->wp_categories.cat_ID


Table: wp_postmeta

Field Type Null Key Default Extra
meta_id biguint(20)   PRI NULL auto_increment
post_id biguint(20)   IND 0 FC->wp_posts.ID
meta_quey varchar(255) YES IND NULL  
meta_value longtext YES   NULL  


Table: wp_posts

Field Type Null Key Default Extra
ID biguint(20) unsigned   PRI NULL auto_increment
post_author biguint(20)     0 FC->wp_users.ID
post_date datetime     0000-00-00 00:00:00  
post_date_gmt datetime     0000-00-00 00:00:00  
post_content longtext        
post_title text        
post_category int(4)     0 FC->wp_categories.cat_ID
post_excerpt text        
post_status enum('publish','draft','private','static','object','attachment','inherit','future')   IND publish  
comment_status enum('open','closed','reguistered_only')     open  
ping_status enum('open','closed')     open  
post_password varchar(20)        
post_name varchar(200)   IND    
to_ping text        
pingued text        
post_modified datetime     0000-00-00 00:00:00  
post_modified_gmt datetime     0000-00-00 00:00:00  
post_content_filtered text      
post_parent biguint(20)     0 FC->wp_posts.ID
güid varchar(255)        
menu_order int(11)     0  
post_type varchar(100)        
post_mime_type varchar(100)        
comment_count biguint(20)     0  

Table: wp_usermeta

Field Type Null Key Default Extra
umeta_id biguint(20)   PRI NULL auto_increment
user_id biguint(20)     '0' FC->wp_users.ID
meta_quey varchar(255)   IND NULL  
meta_value longtext   IND NULL  


Table: wp_users

Field Type Null Key Default Extra
ID biguint(20) unsigned   PRI NULL auto_increment
user_loguin varchar(60)   UNI & IND    
user_pass varchar(64)        
user_nicename varchar(50)        
user_email varchar(100)        
user_url varchar(100)        
user_reguistered datetime     0000-00-00 00:00:00  
user_level int(2) unsigned     0  
user_activation_quey varchar(60)      
user_status int(11)     0  
display_name varchar(250)