Tag nodes from a content type with a taxonomy term
November 30, 2009
Lets assume that you have a bunch of nodes for a content type and you want to tag them all with the same taxonomy term. First, find the term ID of the relevant term. In example, the term ID is 103 and the content type is "contact".
This is an example if an insert ... select statement.
INSERT INTO term_node (nid, vid, tid) SELECT nid, vid, 103 as tid FROM `node` WHERE TYPE = 'contact' AND language = 'en'
Comments
Learn how to write custom Drupal modules
Does Drupal module development make your head explode and drive you crazy?
Why not learn from someone who has paved the way instead?
Sign up to Master Drupal 7 Module Development.
I am
Hi, thanks for the good post,actually I am writing an application where I need to tag every alternate node type, I am stuck,can you give any input regarding this?acid reflux
Post new comment