Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Updated Saturday, August 30th, 2008 at 5:17pm

WordPress 2.3+ Database Structure for Categories

With the release of WordPress 2.3, there were several major changes to the database structure. Most notably was the new taxonomy schema, which replaced the categories, post2cat, and link2cat tables in favor of a new term based system with three new tables – terms, term_taxonomy, and term_relationships. While there are plenty of guides on the new structure, this is a simple visual guide to the relationships of these tables – specifically for category handling. This information is really only useful for those who are writing plugins or other code that interface with the database directly, and want a handy reminder of the table relationships.


The descriptions of the table fields in the reference image below just apply to categories. The taxonomy schema is also used to handle several other objects.

When writing queries to link the tables together, be sure to use the following statement so that the results are limited to category objects:

(table_prefix)_term_taxonomy.taxnomy = 'category'

WordPress 2.3+ Database Structure for Categories

Just right-click to save the image.

  If you have found this page useful, please consider donating. Thanks!

Pages: [5] 4 3 2 1 » Show All

  1. must be examined before use. thanks.

  2. kerenn bgt

  3. kerennn bgt broo

  4. This is the most qualified sites that I had never met before. Thank you for serving the many articles and useful information to the reader.

  5. thanks for sharing

  6. i love to write on this quality blog and this link list plugin in good enough

  7. I love this article. :D

  8. i was searching this from many days. Finally found the relationship between post and category here. grt work…:)

Pages: [5] 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.

Be sure to wrap all code in <code></code> tags.