WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When save a term which is a child term, if I don't provide specific parent id, will WP make this term's parent 0 ?

share|improve this question
up vote 2 down vote accepted

When you create a term for a hierarchical taxonomy, if you don't specify a parent, its parent ID is set to 0. In other words, it becomes a parent term.

Edited with regards to comments:

  • Add specifically each term you wish to add to the post (parent terms aren't automatically added if their children are).
  • Adding terms to posts does not effect the terms relationship with each other (i.e.. child-parent relationship remains in tact).
share|improve this answer
the term already created as a child of another term. Now I want to assign the child to a post. – Jenny Jul 7 '12 at 15:07
so you want to know if you need to provide the ID of the taxonomy term's parent along with the child term? Do you want to add both child and parent terms to the post? – Stephen Harris Jul 7 '12 at 15:12
I want to add child term to the post, not care the parent being added or not, but want the child term's parent always be the same. – Jenny Jul 7 '12 at 15:13
Edited my answer - does that answer your question? :) – Stephen Harris Jul 7 '12 at 15:16
thanks, that helps! – Jenny Jul 7 '12 at 15:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.