WordPress Database Management
August 6, 2018
WordPress Database Tables Every WordPress installation has 11 default tables in the database. Every table contains data for different functionality of WordPress. structure of these tables,we can easily understand where different parts of your website are stored. A default WordPress installation creates the following tables:
“wp_” is the database prefix we choose its during the installation. It can be different.
List Of Tables:
1. wp_posts : this table contains the all post, page or custom post type data. this table have these columns:
ID – unique number assigned to each post.
post_author – Author id.
post_date – time and date of creation.
post_date_gmt – GMT time and date of creation.
post_content – all post content included html,shortcode and any other type of data.
post_title – title of the post.
post_excerpt – custom intro or short version of the content.
post_status – status of the post, e.g. ‘draft’, ‘pending’, ‘private’, ‘publish’. Also a great WordPress news site.
comment_status – if comments are allowed.
ping_status – if the post allows ping and trackbacks.
post_password – optional password used to view the post.
post_name – URL friendly slug of the post title.
to_ping – a list of URLs WordPress should send pingbacks to when updated.
pinged – a list of URLs WordPress has sent pingbacks to when updated.
post_modified – time and date of last modification.
post_modified_gmt – GMT time and date of last modification.
post_content_filtered – used by plugins to cache a version of post_content typically passed through the “the_content” filter. Not used by WordPress core itself.
post_parent – used to create a relationship between this post and another when this post is a revision, attachment or another type.
guid – Global Unique Identifier.
menu_order – holds the display number for pages and other non-post types.
post_type – the content type identifier.
post_mime_type – only used for attachments, the MIME type of the uploaded file.
comment_count – total number of comments, pingbacks and trackbacks.
2. wp_postmeta : wp_postmeta contains meta information about posts, pages, and custom post types.
meta_id – unique number.
post_id – the ID of the post
meta_key – an identifying key for the piece of data.
meta_value – value of key.
3. wp_terms : wp_terms contains meta information about posts, pages, and custom post types.Terms are items of a taxonomy used to objects .The category and tags are terms that would be contained in this table.
term_id – unique number.
name – name of term.
slug – slug of the term.
term_group – ability for themes or plugins to group terms together to use aliases
4. wp_term_taxonomy: wp_term_taxonomy defines taxonomies for terms defined in wp_terms table.the structure of table allows you to use the same term across different taxonomies
term_taxonomy_id – unique number.
term_id – the ID of the related term.
taxonomy – the slug of the taxonomy.
description – description of the term in this taxonomy.
parent – ID of a parent term. Used for hierarchical taxonomies like Categories.
count – number of post objects assigned the term for this taxonomy.
5. wp_term_relationships : wp_term_relationships manages relationship of post types with terms in wp_terms table. in table Each row defines a relationship between a post in wp_posts and a term of a certain taxonomy in wp_term_taxonomy.
object_id – the ID of the post object.
term_taxonomy_id – the ID of the term / taxonomy.
term_order – allow ordering of terms for an object.
6. wp_comments :wp_comments contains your comments. its shows comment author name, url, email, comment etc.
comment_ID – unique number.
comment_post_ID – ID of the post this comment relates to.
comment_author – comment author name.
comment_author_email –comment author email.
comment_author_url – URL for the comment author.
comment_author_IP – IP Address of the comment author.
comment_date – Time and data the comment was posted.
comment_date_gmt – GMT time and data the comment was posted.
comment_content – the actual comment text.
comment_karma – can be used by plugins to help manage comments.
comment_approved – if the comment has been approved.
comment_agent – where the comment was posted from, eg. browser, operating system etc.
comment_type – type of comment: comment, pingback or trackback.
comment_parent – refers to another comment when this comment is a reply.
user_id – ID of the comment author if they are a registered user on the site.
7.wp_commentmeta : wp_commentmeta contains meta information about comments.
meta_id – unique number.
comment_id – comment post id
meta_key – meta key.
meta_value – value of meta key.
8. wp_options : wp_options contains too much settings of the our website like site url, admin email, default category, posts per page, time format, and much much more. this table is also used by many plugins to store plugin settings.
option_id – unique number.
option_name – key for the piece of data.
option_value – the actual piece of data.
autoload – controls if the option is automatically loaded by the function wp_load_alloptions().
9. wp_links : wp_links contains url of blogging having a blogroll links to other sites on your site
link_id – unique number.
link_url – URL of the link.
link_name – name of the link.
link_image – URL of an image related to the link.
link_target – the target frame for the link.
link_description – description of the link.
link_visible – control if the link is public or private.
link_owner – ID of user who created the link.
link_rating – add a rating between 0-10 for the link.
link_updated – time and date of link update.
link_rel – relationship of link.
link_notes – notes about the link.
link_rss – RSS address for the link.
10. wp_users : wp_users Contains all information regarding to User like username, password, user email, etc.
ID – unique number.
user_login – username for the user.
user_pass – user’s password.
user_nicename – display name for the user.
user_email – email address of the user.
user_url – URL of the user website.
user_registered – time and date the user registered.
user_activation_key – used for resetting passwords.
user_status – was used in Multisite pre WordPress 3.0 to indicate a spam user.
display_name – desired name to be used publicly in the site, can be user_login, user_nicename, first name or last name defined in wp_usermeta.
11. wp_usermeta : wp_usermeta Contains meta information about Users.
umeta_id – unique number.
user_id – ID of the related user.
meta_key – identifying key.
meta_value – value of meta key.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – we are here to solve your problems.