Drupal 8/9 programmatically Create a vocabulary and terms

Create a vocabulary generated by \Drupal\taxonomy\Entity\Vocabulary and create a vocabulary object by using the Vocabulary::create() function. The Drupal::entityManager has been removed in Drupal 9. x and should be replaced with Drupal::entityTypeManager. To create entities, use the create() method of the entity manager service.
copy-icon

Comments

Authors

Read Next