You can just run;
wp_insert_term('football', 'category', array( 'description' => 'Football Blogs', 'slug' => 'category-slug', 'parent' => 4
The function will not add a term if it already exists for this taxonomy!
Of interest, when will you name this code in your plugin? Make sure you register it in the activation activation function, otherwise it will work on every boot!
UPDATE
To get the identifier of the word slug, use;
$term_ID = 0; if ($term = get_term_by('slug', 'term_slug_name', 'taxonomy')) $term_ID = $term->term_id;
Replace "taxonomy" with the taxonomy of this term - in your case, "category".
TheDeadMedic
source share