create category on theme setup

You can use the after_setup_theme for this eg: add_action( ‘after_setup_theme’, ‘custom_add_cat’ ); function custom_add_cat() { //Create Custom Category wp_insert_term( ‘Custom Category’, ‘category’, array(‘slug’ => ‘custom-category’) ); } Read here for more info: https://developer.wordpress.org/reference/hooks/after_setup_theme/