WordPress 2.3 introduces our new taxonomy schema. This new schema replaces the categories, post2cat, and link2cat tables with three new tables that are more flexible. The first table is the terms table. It holds the basic information about a term.
term_id bigint(20) NOT NULL auto_increment, name varchar(55) NOT NULL default '', slug varchar(200) NOT NULL default '', term_group bigint(10) NOT NULL default 0, PRIMARY KEY (term_id), UNIQUE KEY slug (slug)
“name” is simply the name of the term. “slug” is the name reduced to a URL friendly form. “term_group” is a means of grouping together similar terms. “term_id” is a unique ID for the term.
A term is not a category or tag on its own. It must be given context via the term_taxonomy table.
term_taxonomy_id bigint(20) NOT NULL auto_increment, term_id bigint(20) NOT NULL default 0, taxonomy varchar(32) NOT NULL default '', description longtext NOT NULL, parent bigint(20) NOT NULL default 0, count bigint(20) NOT NULL default 0, PRIMARY KEY (term_taxonomy_id), UNIQUE KEY term_id_taxonomy (term_id,taxonomy)
The term_taxonomy table places a term within a taxonomy. This is what makes a term a category or tag (or both). “term_id” is the ID of a term in the terms table. “taxonomy” designates the taxonomy in which the term resides. The default taxonomies are “category”, “link_category”, and “post_tag”. “term_taxonomy_id” is a unique ID for the term+taxonomy pair. The rest of the fields provide information about the term in the context of the taxonomy. The “parent” field keeps track of hierarchical relationships between terms in the taxonomy. “description” provides a taxonomy specific description of the term. “count” tracks how many objects are associated with the term+taxonomy pair. Given a taxonomy of “category”, “count” tracks how many posts are in the category.
The final table, term_relationships, relates objects such as posts or links to a term_taxonomy_id from the term_taxonomy table.
object_id bigint(20) NOT NULL default 0, term_taxonomy_id bigint(20) NOT NULL default 0, PRIMARY KEY (object_id,term_taxonomy_id), KEY term_taxonomy_id (term_taxonomy_id)
“object_id” is the ID of a post or link. “term_taxonomy_id” is an ID from the term_taxonomy table designating a particular term+taxonomy pair.
The flexibility of the schema and API means plugins can add new taxonomies and object types quite easily. One of the Summer of Code projects does just that. The flexibility also allows us to easily retrieve all objects associated with a given term regardless of taxonomy, retrieve all terms from all taxonomies for a given object, and convert all categories to tags with one query.
The taxonomy schema is hidden behind a fairly comprehensive taxonomy API. The category API remains as a backward compatibility layer on top of the taxonomy API. Plugins that use the category API should not require any changes when upgrading to 2.3. Plugins that perform direct SQL queries on the categories, link2cat, or post2cat tables will break, unfortunately.
And that’s the new schema. It will break a few plugins in the short term, but in the long term it will allow us to add any new taxonomies that come along without needing to change the schema again.
Will there be an importer for UTW? UTW is an incredible plugin but I’d rather use the core instead of a plugin.
A UTW importer is bundled with WP 2.3.
Hooray!
I’ve only recently switched to the “Simple Tagging” plugin because I’d had problems with UTW, I don’t suppose there will be an importer for that too?
I guess if I need to I can just import from my UTW tags and then update the tags for the new posts I’ve created since switching.
Other than that, the taxnomy schema looks pretty good I look forward to playing around with it.
Baris, if you download the current trunk version of WP you can try the importer out now; just go to Manage > Import > Ultimate Tag Warrior. I tried it out today on the Tarski site and it worked perfectly.
I am using Simple Tag for my blog, will WordPress 2.3 include an importer for it too? Because I would hate to have to re-tag everything again
[...] up folks that the upcoming new version of WordPress will break my Organize Series Plugin. I just read a great article about the new Taxonomy Schema changes that will be introduced with the new vers… and unfortunately due to the way I designed the plugin, Organize Series won’t work with [...]
Awesome, I’m so glad it imports from UTW. I’ll be grabbing the public beta tomorrow for some bug squashing.
Will this new schema break a lot (most) of the plugins out there?
@Jonathan Dingman: Yes because the wp-admin got restructure. Personally I make use of wp-admin/upgrade-functions.php (WP 2.1+) but in WP 2.3 it is now wp-admin/includes/upgrade.php
Convert my tag system to WP 2.3 will be a big trouble, but I’ll take it too.
Any importer included for the simple-tagging plugin? as opposed to utw…
I am using simple tag in my blog. Will there be an import in WordPress 2.3 to handle simple tag too?
[...] den Aufbau und die Funktion der einzelnen Felder näher interessiert, dem sei der Artikel „WordPress 2.3 Taxonomy Schema“ [...]
[...] han apostado por un modelo de 3 tablas que nos permiten enlazar taxonomías con terminos. Ya podemos ver estas tres tablas para hacernos una idea de como afrontar las nuevos plugins que desarrollemos para [...]
[...] Ryan Boren has posted an explanation of database changes in WordPress 2.3 related to taxonomy – a new way of tagging and categorizing posts and [...]
[...] This new feature required a few changes in the WordPress database scheme. Gladly, Ryan Boren has posted the description of changes in the database structure. [...]
[...] Trovate una spiegazione piuttosto dettagliata della struttura delle nuove tabelle sul blog di Boren. [...]
[...] Boren gibt auf seinem Blog eine Übersicht der 3 neuen Tabellen terms, term_taxonomy und term_relationships, welche die alten Tabellen [...]
What does UTW stand for?
[...] (fonte) [...]
[...] stata annunciata la nuova minor release di WordPress, che vedrà la luce a settembre, e con essa un nuovo [...]
Someone submitted a Simple Tagging importer but we haven’t done anything with it yet. If anyone wants to try it out and give feedback, we can work it into 2.3.
@Ryan: I have tested the Simple Tagging Importer with a nightly build of WordPress 2.3 and it works very well.
[...] de sus novedades más destacadas. WP echa mano de un nuevo sistema de taxonomía, soportado por el cruce de los datos de tres tablas (’terms table’, ‘term_taxonomy table’ y ‘term_relationships [...]
@GO, UTW stands for Ultimate Tag Warrior; a popular WordPress plugin made by a great kiwi coder.
http://neato.co.nz/ultimate-tag-warrior
[...] you’re into the nitty-gritty see Ryan Boren’s post » WordPress 2.3 Taxonomy Schema boren.nu [...]
Will classic UTW ( Go: UTW = UltimateTagWarior, a classic monster plugin) functionality like tagclouds and lists of related posts still require plugins or be part of the WordPress core?
[...] tags look like they are using a similar idea to the Drupal taxonomy concepts – should be [...]
Looks like I’ll have to be holding back from the 2.3 upgrade for a while then as a lot of my sites are plugin dependent
I’m not clear about the purpose of term_group. Isn’t that just a way to categorize the term? If so, doesn’t that belong in the taxonomy table?
[...] ) – جداول جدید برای تگ ها ، دسته بندی مطالب و لینک ها ( اطلاعات بیشتر ) – بهبود آدرسی دهی قسمت های مختلف برای دوستی بیشتر با [...]
[...] Boren.nu 28 août 2007 Amaury WordPress Share This [...]
[...] The first obvious addition is the tagging system that was not available in previous WordPress versions. Tagging allows more room for organization when your simple list of categories isn’t going to cut it anymore. For details about this new feature, read Ryan Boren’s post, WordPress 2.3 Taxomony Schema. [...]
Hi. Will this new schema break a lot of the plugins out there? Thanks !
[...] tags support, faster javascript, and SEO-friendly URL redirection. Another key update is the new Taxonomy Schema, which replaces the old categories schema. 0 comments | wordpress.org [...]
[...] ) – جداول جدید برای تگ ها ، دسته بندی مطالب و لینک ها ( اطلاعات بیشتر ) – بهبود آدرسی دهی قسمت های مختلف برای دوستی بیشتر با [...]
[...] like to convert their existing categories to tags. Due to the flexibility of the new tag system (taxonomy system is more accurate), I expect we will see an explosion of new tagging plugins. There have been [...]
[...] next week and with it finally comes the long awaited built-in tagging functions, as described in WordPress 2.3 Taxomony Schema by Ryan Boren and by WPDesigner, Plugin and core update notification, faster javascript, and SEO-friendly URL [...]
[...] Boren’s WordPress Taxonomy addthis_url = ‘http%3A%2F%2Fjsuresh.net%2Fblog%2F2007%2F08%2F30%2Fwordpress-23-beta-1%2F’; addthis_title = ‘WordPress+2.3+Beta+1′; addthis_pub = ”; [...]
[...] detto inoltre come la nuova versione 2.3 apporti delle novità importanti, una su tutte il nuovo sistema di categorizzazione che ha visto rimpiazzate le tabelle categories, post2cat, e link2cat cosa che probabilmente [...]
[...] 翻译自:WordPress 2.3 Taxonomy Schema,正在校对中,欢迎并感谢指出错误。 [...]
[...] Etiquetas con listas de etiquetas, nubes de tagas y más para divertirte etiquetando [...]
Crow: term_group is used for aliasing. If you want to make two terms equivalent, then they go into the same group. This allows you to make two different tags that work together. Like I could create a tag for “coke” and “coca-cola” and when I pulled posts for either tag, I’d get both of them back.
[...] специалистите тази статия за таговете в WordPress 2.3 може би ще им говори нещо, а за неспециалистите тази [...]
[...] websites, because of its flexibility and powerful template system. In the new versions it has better categorization, and seems to be similar to that of Drupal. Another CMS which offers unique set of features is [...]
[...] Taxonomy changes, Taxonomy API [...]
[...] » WordPress 2.3 Taxonomy Schema boren.nu [...]
[...] With WordPress 2.3 about to be released, I had to update some code I used to correspond with the new taxonomy schema. [...]
[...] 分类变更,分类接口 (Taxonomy changes, Taxonomy API) [...]
[...] 10 Things you need to know about WordPress 2.3; 2. WordPress 2.3 Taxonomy Schema; 3. Como exibir Tags no WordPress 2.3; 4. Lista de Plugins Compatíveis com o WordPress 2.3; 5. [...]
[...] can I, alone, resolve it? That’s what I’d like to know. But yeah, it all involves the new taxonomy schema version 2.3 [...]
[...] just upgraded WordPress to version 2.3 RC 1 at my test blog, and found out that changes in the taxonomy schema break my Parental Control plugin in a nasty way. Fortunately, it was quite easy to [...]
[...] Taxonomy changes, Taxonomy API [...]
How can i see in plugin code when they have a call to post2cat or link2cat?
[...] sw-guide.de: WordPress-Update auf 2.3: Rückschritt? Die Tabellenänderungen beschreibt WordPress 2.3 Taxonomy Schema [...]
[...] upgrading my other blog planet-punk.de. I like and do use tags a lot, but for the time being, the greatest db scheme doesn’t help a somewhat unusable ui. Don’t get me wrong, i really like the changes in [...]
[...] thought the schema changes would kill my blog. I even created a testbed to test if the upgrades will work smoothly. I tried [...]
[...] Una delle novità principali della versione 2.3 riguarda la nuova gestione dei tag, per questa nuova funzionalità la struttura dei database è cambiata in maniera significativa, di seguito la traduzione di un articolo di Ryan Boren a riguardo: [...]
[...] 分类变更,分类接口 (Taxonomy changes, Taxonomy API) [...]
[...] da unter anderem die Tag-Wolke und die Kategorien-Liste nicht kompatibel sind zum neuen Taxonomie-Konzept von WordPress 2.3 [...]
[...] Taxonomy changes, Taxonomy API [...]
[...] zwar gibt es nach Version 2.1 erneut eine Änderung am Datenbankschema, was das Thema Kategorien betrifft. Dies wäre bei jeder anderen Software kein Problem, doch [...]
[...] The code broke as it relied on the old category system, which was replaced by a new, more flexible, taxonomy system. The new schema is well designed too, and the new queries are much cleaner as a result. [...]
Unwakeable: The Future And WordPress 2.3…
I’ve waited far too long to post an update on Unwakeable 2.0 and it’s status, so here it is, almost. First, I’d like to address the issues with the current Unwakeable release (version 1.2.1) and WordPress 2.3. Hold on, cuz thereR…
[...] zur neuen Tabellenstruktur gibt es bei boren.nu. abgelegt unter WordPress and Serendipity um [...]
[...] an indepth look at the structure and specific template tags and handling of tags in WordPress, Ryan Boren has written a “Taxonomy Scheme” with all the [...]
[...] » WordPress 2.3 Taxonomy Schema boren.nu [...]