First of all you want to add it only once, so you have to check if it exists. Then you can use wp_insert_term function
if ( !term_exists('MyCategory1', 'genre') ) {
wp_insert_term('MyCategory1', 'genre');
}
First of all you want to add it only once, so you have to check if it exists. Then you can use wp_insert_term function
if ( !term_exists('MyCategory1', 'genre') ) {
wp_insert_term('MyCategory1', 'genre');
}