Title: wp_insert_term() Help
Last modified: August 19, 2016

---

# wp_insert_term() Help

 *  [Yojance Rabelo](https://wordpress.org/support/users/yojance/)
 * (@yojance)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/wp_insert_term-help/)
 * Hi everyone, I need some help with wp_insert_term(), its not doing what I think
   should be doing.
 * I created a custom post type called car_listings and then added a taxonomy to
   it:
 * `register_taxonomy('car_cylinders', 'car_listings', $args);`
 * I’m now trying to do the following without success:
 * `wp_insert_term('4', 'car_cylinders');`
 * Am I jumping steps here? I think that’s the correct way of doing it because I
   don’t need to set a parent or anything, just add 4 the car_cylinders taxonomy.
 * Can anyone help me? Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Yojance Rabelo](https://wordpress.org/support/users/yojance/)
 * (@yojance)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/wp_insert_term-help/#post-1799301)
 * I turn the code into a function and then added the function to init and it worked.
   The problem I’m having now is that when I try to delete it through the back-end,
   it doesn’t let me.
 * I wonder if it has anything to do with me working on my localhost.
    Any suggestions?

Viewing 1 replies (of 1 total)

The topic ‘wp_insert_term() Help’ is closed to new replies.

## Tags

 * [wp_insert_term](https://wordpress.org/support/topic-tag/wp_insert_term/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Yojance Rabelo](https://wordpress.org/support/users/yojance/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/wp_insert_term-help/#post-1799301)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
