After you get the new tags into wp_terms (and clean up those slugs!!!), you need to add them to the terms taxonomy. Note: WP uses three tables to track Tags, Categories, and Link Categories. They are:
1) wp_terms, which holds the tag names and their URL friendly 'slugs' as well as an id and a useless (since I don't know what it does) field called term_group - which has been '0' for whatever I have tried to add to Categories, Link Categories, and Tags in my experimentation
2) wp_term_taxonomy, which holds the descriptions of your tags as well as which type of tag they are and their hierarchy (for Categories).
3) wp_term_relationships, which relates these tags to your posts and pages.
Let's take a closer look at wp_term_taxonomy:
`term_taxonomy_id` bigint(20) unsigned NOT NULL auto_increment,
`term_id` bigint(20) unsigned NOT NULL default '0',
`taxonomy` varchar(32) NOT NULL default '',
`description` longtext NOT NULL,
`parent` bigint(20) unsigned NOT NULL default '0',
`count` bigint(20) NOT NULL default '0',
PRIMARY KEY (`term_taxonomy_id`),
UNIQUE KEY `term_id_taxonomy` (`term_id`,`taxonomy`),
KEY `taxonomy` (`taxonomy`)At this point, what we need to do is check to see if all the tags in wp_terms are in wp_term_taxonomy. If not, we need to add their term_id's and fill in some information. Don't get too carried away. At this point, we only want to bother with the
term_id and taxonomy columns for post-tags and term_id, taxonomy, description, and parent for Categories. If you choose not to play with Categories, your life is easier. If you like Categories, you have more work to do, but you benefit from being able to further customize your content [I am talking about using themes and presenting category.php]. An excellent discussion of the difference between Categories and Tags is found at the WordPress Codex.Let's just pretend we have a jumble of stuff and some of it is categories and some is tags. (now I wish I hadn't told you to DELETE TABLE tags when you were through with inserting tags into wp_terms). Go back in time, and imagine that I hadn't. We are going to use TABLE tags here.
more later

No comments:
Post a Comment